-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (43 loc) · 934 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
39
40
41
42
43
44
45
var webpack = require('webpack')
var path = require('path')
var libraryName = 'react-teatrum'
var config = {
entry: __dirname + '/src/index.js',
output: {
path: __dirname + '/dist',
filename: libraryName + '.min.js',
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true,
},
module: {
loaders: [
{
test: /(\.jsx|\.js)$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom',
},
},
plugins: [new webpack.optimize.UglifyJsPlugin({ comments: false })],
resolve: {
modules: [path.resolve('./src')],
extensions: ['.js'],
},
devtool: 'source-map',
}
module.exports = config