-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (37 loc) · 949 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 webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const fs = require('fs');
module.exports = {
entry: {
app: './src/index.js'
},
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'dist'),
publicPath: '/'
},
/*devtool: 'source-map',*/
plugins: [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src/index.html'),
filename: 'index.html'
}),
/*new UglifyJSPlugin({
uglifyOptions: {
mangle: false
}
}),*/
new webpack.BannerPlugin({
banner:
new Date().toLocaleDateString() +
' ' +
new Date().toLocaleTimeString() +
'\n\n' +
fs.readFileSync('./LICENSE.txt', 'utf8')
})
]
};