-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.prod.config.js
68 lines (66 loc) · 1.78 KB
/
webpack.prod.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
var path = require('path');
var webpack = require('webpack');
console.log(path.resolve(__dirname, 'src/js/components'))
module.exports = {
entry: {
main: './src/js/bundles/main.js',
utils: './src/js/bundles/utils.js',
deputy: './src/js/bundles/deputy.js',
attendance: './src/js/bundles/attendance.js',
chamber: './src/js/bundles/chamber.js'
},
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: "[name].bundle.js"
},
module: {
rules: [
{
// test: /\.js$/,
test: /\.js?$/,
loader: 'babel-loader',
exclude: ['/node_modules/'],
query: {
compact: false,
presets: ['react', 'es2015', 'stage-0']
}
},
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: {
attrs: [':data-src']
}
}
}
]
},
stats: {
colors: true
},
devtool: 'source-map',
resolve: {
modules: [
'node_modules',
'node_modules/react-echarts-v3/src',
path.resolve(__dirname, 'src/js/components'),
path.resolve(__dirname, 'src/js/services'),
path.resolve(__dirname, 'src/js/template')
],
extensions: ['.js', '.jsx']
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
extractComments: true,
sourceMap: false
}),
new webpack.ProvidePlugin({
$: "jquery", // Used for Bootstrap JavaScript components
jQuery: "jquery", // Used for Bootstrap JavaScript components
Popper: ['popper.js', 'default'] // Used for Bootstrap dropdown, popup and tooltip JavaScript components
})
]
};