-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
39 lines (36 loc) · 1020 Bytes
/
webpack.common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const path = require('path');
// use for multiple html files and to create output folder structure
// replace plugins in module.exports with "plugins: HtmlPluginEntries"
// const entries = {
// app: ["/scripts/index.js", "/stylesheets/main.css"],
// };
// const HtmlPluginEntries = Object.keys(entries).map(entryName => {
// return new HtmlWebpackPlugin({
// template: `/${entryName}/template.html`,
// filename: `${entryName}/index.html`,
// chunks: [entryName],
// inject: "body",
// minify: false,
// });
// });
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: {
app: '/scripts/index.js',
// use to avoid importing css file inside of js file:
// import normalize inside style.css to split into its own in head
// app: ["./src/scripts/index.js", "./src/stylesheets/style.css"],
},
module: {
rules: [
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
},
],
},
],
},
};