-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (54 loc) · 1.22 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
61
var path = require('path');
var webpack = require('webpack');
var env = process.env.NODE_ENV;
var plugins = [
new webpack.optimize.OccurenceOrderPlugin()
];
if (env === 'production') {
plugins.push(new webpack.optimize.UglifyJsPlugin({
compressor: {
pure_getters: true,
unsafe: true,
unsafe_comps: true,
screw_ie8: true,
warnings: true
}
}));
}
var reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
};
var reactDomExternal = {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
};
module.exports = {
entry: {
index: './src/Scrollable.js'
},
output: {
path: path.join(__dirname, '/dist/'),
library: 'react-scrollable',
libraryTarget: 'umd'
},
externals: {
'react': reactExternal,
'react-dom': reactDomExternal
},
plugins: plugins,
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
//exclude: /node_modules/,
//include: path.join(__dirname, '/src/')
}
]
}
};