Commit e95d1bde authored by wildfirecode's avatar wildfirecode

1

parent 572b9b35
...@@ -7,11 +7,9 @@ ...@@ -7,11 +7,9 @@
<body> <body>
<div id="example"></div> <div id="example"></div>
<!-- Dependencies -->
<script src="./node_modules/react/umd/react.development.js"></script> <script src="./node_modules/react/umd/react.development.js"></script>
<script src="./node_modules/react-dom/umd/react-dom.development.js"></script> <script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
<!-- Main -->
<script src="./dist/main.js"></script> <script src="./dist/main.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "webpack.config.js", "main": "webpack.config.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "start": "webpack-dev-server --config webpack.config.js --open"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
"ts-loader": "^7.0.5", "ts-loader": "^7.0.5",
"typescript": "^3.9.3", "typescript": "^3.9.3",
"webpack": "^4.43.0", "webpack": "^4.43.0",
"webpack-cli": "^3.3.11" "webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"
}, },
"dependencies": { "dependencies": {
"react": "^16.13.1", "react": "^16.13.1",
......
...@@ -2,8 +2,6 @@ import * as React from "react"; ...@@ -2,8 +2,6 @@ import * as React from "react";
export interface HelloProps { compiler: string; framework: string; } export interface HelloProps { compiler: string; framework: string; }
// 'HelloProps' describes the shape of props.
// State is never set so we use the '{}' type.
export class Hello extends React.Component<HelloProps, {}> { export class Hello extends React.Component<HelloProps, {}> {
render() { render() {
return <h1>Hello from {this.props.compiler} and {this.props.framework}!</h1>; return <h1>Hello from {this.props.compiler} and {this.props.framework}!</h1>;
......
module.exports = { module.exports = {
mode: "production", mode: "production",
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map", devtool: "source-map",
resolve: { resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx"] extensions: [".ts", ".tsx"]
}, },
...@@ -20,7 +18,6 @@ module.exports = { ...@@ -20,7 +18,6 @@ module.exports = {
} }
] ]
}, },
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ {
enforce: "pre", enforce: "pre",
test: /\.js$/, test: /\.js$/,
...@@ -28,11 +25,6 @@ module.exports = { ...@@ -28,11 +25,6 @@ module.exports = {
} }
] ]
}, },
// When importing a module whose path matches one of the following, just
// assume a corresponding global variable exists and use that instead.
// This is important because it allows us to avoid bundling all of our
// dependencies, which allows browsers to cache those libraries between builds.
externals: { externals: {
"react": "React", "react": "React",
"react-dom": "ReactDOM" "react-dom": "ReactDOM"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment