-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (54 loc) · 1.25 KB
/
webpack.config.js
File metadata and controls
56 lines (54 loc) · 1.25 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// clara says
// __ __ __
// / /_ ____ / /___/ / __ ______
// / __ \/ __ \/ / __ / / / / / __ \
// / / / / /_/ / / /_/ / / /_/ / /_/ /
// /_/ /_/\____/_/\__,_/ \__,_/ .___/
// /_/
// don't worry about this
// But if you want to know more, go check out webpack.md
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const path = require('path'),
html = require('html-webpack-plugin'),
webpack = require('webpack'),
commons = 'commons';
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: {
index: './src/index.js'
},
plugins: [
new CleanWebpackPlugin(),
new html({
filename: 'index.html',
template: './src/template.html',
inject: true,
chunks: [commons, 'index']
})
],
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: ''
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
]
}
};