-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.dev.js
42 lines (41 loc) · 1.15 KB
/
webpack.config.dev.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
40
41
42
/* eslint-disable no-undef */
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
index: './src/index.js',
about: './src/pages/about/about.js',
post: './src/11ty-layouts/post/post.js'
},
output: {
filename: '[name].bundle.js',
publicPath: '/'
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html',
chunks: ['index'],
excludeChunks: ['about', 'post'],
filename: './index.html'
}),
new HtmlWebpackPlugin({
template: './src/pages/about/about.html',
chunks: ['about'],
filename: 'about/index.html'
}),
new HtmlWebpackPlugin({
template: './src/11ty-layouts/post/post.html',
chunks: ['post'],
filename: 'posts/index.html'
})
],
module: {
rules: [
{
test: /\.css$/i,
exclude: path.resolve(__dirname, './src/modules/'),
use: ['style-loader', 'css-loader', 'postcss-loader']
}
]
}
};