forked from blueskydigital/bstrap-react-mobx-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
48 lines (47 loc) · 1.52 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
var path = require('path')
var babelOptions = {
'presets': ['react', 'stage-0', ['es2015', {'modules': false}]],
'plugins': [
'transform-object-rest-spread',
'transform-decorators-legacy',
'transform-class-properties'
]
}
module.exports = (env = {dev: true}) => {
return {
devtool: env.dev ? 'inline-sourcemap' : 'source-map',
entry: './src/index.js',
module: {
loaders: [{test: /\.js$/, loader: 'babel-loader', options: babelOptions}]
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bstrap-react-mobx-admin.min.js',
library: 'bstrap-react-mobx-admin',
libraryTarget: 'umd'
},
externals: {
'underscore': {
root: '_', commonjs: 'underscore', commonjs2: 'underscore', amd: 'underscore'
},
'prop-types': {
root: 'propTypes', commonjs: 'prop-types', commonjs2: 'prop-types'
},
'react': {
root: 'React', commonjs: 'react', commonjs2: 'react', amd: 'react'
},
'react-dom': {
root: 'ReactDOM', commonjs: 'react-dom', commonjs2: 'react-dom', amd: 'react'
},
'mobx-react': {root: 'mobxReact', commonjs: 'mobx-react', commonjs2: 'mobx-react'},
'react-bootstrap': {commonjs: 'react-bootstrap', commonjs2: 'react-bootstrap'},
'react-mobx-admin': {
commonjs: 'react-mobx-admin', commonjs2: 'react-mobx-admin'
},
'react-bootstrap-date-picker': {
commonjs: 'react-bootstrap-date-picker',
commonjs2: 'react-bootstrap-date-picker'
}
}
}
}