-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (37 loc) · 917 Bytes
/
webpack.config.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
const path = require('path');
const HashPlugin = require('hash-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
mode: 'production',
watch: true,
//entry: path.join(__dirname, 'webpack', 'main'),
entry: {
'main': './assets/js/script/all.js',
'slim': './assets/js/slim/slim.js'
},
output: {
filename: '[name].[hash].bundle.js',
path: path.resolve(__dirname, 'assets', 'js', 'dist')
},
module: {
rules: [
{
test: /.js$/,
exclude: [
path.resolve(__dirname, 'node_modules')
],
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env']
}
}
]
},
plugins: [
new HashPlugin({ path: './_data/', fileName: 'hash.yml' }),
new CleanWebpackPlugin({ path: './assets/js/dist/' })
],
resolve: {
extensions: ['.json', '.js', '.jsx']
}
};