Skip to content

Commit 68f8eb8

Browse files
committed
HtmlWebpackPlugin sourcing from public
1 parent 80fd313 commit 68f8eb8

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

webpack.config.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
const path = require('path')
2-
const HtmlWebpackPlugin = require('html-webpack-plugin')
3-
const CopyPlugin = require('copy-webpack-plugin')
1+
const path = require("path");
2+
const HtmlWebpackPlugin = require("html-webpack-plugin");
3+
const CopyPlugin = require("copy-webpack-plugin");
44

55
module.exports = {
6-
entry: './app/index.js',
6+
entry: "./src/index.js",
77
output: {
8-
path: path.resolve(__dirname, 'dist'),
9-
filename: 'index_bundle.js',
10-
publicPath: '/'
8+
path: path.resolve(__dirname, "dist"),
9+
filename: "index_bundle.js",
10+
publicPath: "/",
1111
},
1212
module: {
1313
rules: [
14-
{ test: /\.(js)$/, use: 'babel-loader' },
15-
{ test: /\.css$/, use: [ 'style-loader', 'css-loader' ]}
16-
]
14+
{ test: /\.(js)$/, use: "babel-loader" },
15+
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
16+
],
1717
},
18-
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
18+
mode: process.env.NODE_ENV === "production" ? "production" : "development",
1919
plugins: [
2020
new HtmlWebpackPlugin({
21-
template: 'app/index.html'
21+
template: "./public/index.html",
2222
}),
2323
new CopyPlugin({
24-
patterns: [
25-
{ from: '_redirects' }
26-
]
27-
})
24+
patterns: [{ from: "./public/_redirects" }],
25+
}),
2826
],
2927
devServer: {
30-
historyApiFallback: true
31-
}
32-
}
28+
historyApiFallback: true,
29+
},
30+
};

0 commit comments

Comments
 (0)