-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
51 lines (50 loc) · 1.11 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
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: './src/index',
devtool: 'source-map',
resolve: {
root: path.resolve('./src'),
extensions: ['', '.js'],
fallback: [path.join(__dirname, 'node_modules')]
},
resolveLoader: {
fallback: [path.join(__dirname, 'node_modules')]
},
output: {
path: __dirname + '/lib',
filename: 'index.js',
// library: 'pr-common',
libraryTarget: 'umd',
umdNamedDefine: true
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({
'React': 'react'
}),
new webpack.ProvidePlugin({
'ReactDOM': 'react-dom'
}),
],
module: {
loaders: [{
test: /(\.jsx|\.js)$/,
loader: 'babel',
exclude: /node_modules/,
query: {
compact: false
},
}]
},
externals: {
'alt': 'alt/lib',
'react': 'react',
'axios': 'axios',
'react-dom': 'react-dom',
'react-router': 'react-router',
'material-ui': 'material-ui',
'formsy-material-ui': 'formsy-material-ui',
'formsy-react': 'formsy-react'
}
};