Skip to content

Commit 818332a

Browse files
committed
Update webpack config. Omit index.js from index.html.
1 parent 1d361c2 commit 818332a

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Diff for: index.html

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
</head>
77

88
<body>
9-
<script src="./src/index.tsx"></script>
109
<div id="root">
1110
<!-- app loads here... -->
1211
</div>

Diff for: webpack.config.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
const path = require('path');
1+
const path = require("path");
22
const HtmlWebpackPlugin = require("html-webpack-plugin");
33

44
module.exports = {
5-
entry: './src/index.tsx',
6-
devtool: 'inline-source-map',
5+
entry: "./src/index.tsx",
6+
devtool: "source-map",
77
module: {
88
rules: [
99
{
1010
test: /\.tsx?$/,
11-
use: 'ts-loader',
11+
use: "ts-loader",
1212
exclude: /node_modules/,
1313
},
1414
],
1515
},
1616
resolve: {
17-
extensions: [ '.tsx', '.ts', '.js' ],
17+
extensions: [".tsx", ".ts", ".js"],
1818
},
1919
output: {
20-
filename: 'bundle.js',
21-
path: path.resolve(__dirname, 'dist'),
20+
filename: "bundle.js",
21+
path: path.resolve(__dirname, "dist"),
2222
},
2323
plugins: [
2424
new HtmlWebpackPlugin({
25-
template: path.resolve(__dirname, "index.html")
26-
})
25+
template: path.resolve(__dirname, "index.html"),
26+
}),
2727
],
2828
devServer: {
29-
contentBase: path.resolve(__dirname, './dist')
29+
contentBase: path.resolve(__dirname, "./dist"),
30+
historyApiFallback: {
31+
index: "/",
32+
},
3033
},
31-
};
34+
};

0 commit comments

Comments
 (0)