-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·60 lines (58 loc) · 1.34 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: __dirname,
entry: [
'./src/index.js'
],
output: {
path: path.resolve('./dist/'),
filename: "index.js",
library: 'v',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: false,
dead_code: true,
unused: true,
booleans: true,
join_vars: true,
negate_iife: true,
sequences: true,
properties: true,
evaluate: true,
loops: true,
if_return: true,
cascade: true,
unsafe: true
},
output: {
comments: false
}
}),
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!promise-polyfill'
})
],
module: {
loaders: [
// we pass the output from babel loader to react-hot loader
{ test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: [
'babel-loader?presets[]=es2015&presets[]=stage-0'
],
},
],
},
resolve: {
root: path.resolve(__dirname, '.'),
modulesDirectories: ['node_modules', 'bower_components'],
extensions: ['', '.js', '.jsx'],
},
};