Skip to content

Commit 6de03cb

Browse files
committed
Update webpack config. Omit index.js from index.html.
1 parent 4cff730 commit 6de03cb

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

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.js"></script>
109
<div id="root">
1110
<!-- app loads here... -->
1211
</div>

webpack.config.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const path = require("path");
22
const HtmlWebpackPlugin = require("html-webpack-plugin");
33

44
module.exports = {
5+
entry: "./src/index.js",
6+
devtool: "source-map",
57
module: {
68
rules: [
79
{
@@ -12,18 +14,21 @@ module.exports = {
1214
],
1315
},
1416
resolve: {
15-
extensions: ['*', '.js', '.jsx'],
17+
extensions: [".js", ".jsx"],
1618
},
1719
output: {
18-
path: path.resolve(__dirname, './dist'),
19-
filename: 'bundle.js',
20+
path: path.resolve(__dirname, "./dist"),
21+
filename: "bundle.js",
2022
},
2123
plugins: [
2224
new HtmlWebpackPlugin({
23-
template: path.resolve(__dirname, "index.html")
24-
})
25+
template: path.resolve(__dirname, "index.html"),
26+
}),
2527
],
2628
devServer: {
27-
contentBase: path.resolve(__dirname, './dist')
29+
contentBase: path.resolve(__dirname, "./dist"),
30+
historyApiFallback: {
31+
index: "/",
32+
},
2833
},
2934
};

0 commit comments

Comments
 (0)