forked from nkbt/react-collapse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.bower.js
56 lines (52 loc) · 1.17 KB
/
webpack.config.bower.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
'use strict';
var webpack = require('webpack');
var path = require('path');
var babelLoader = 'babel?' +
JSON.stringify({
presets: ['es2015', 'react'],
plugins: ['transform-es2015-modules-commonjs', 'transform-object-rest-spread']
});
module.exports = {
devtool: 'source-map',
entry: './src/index.js',
output: {
filename: require('./package.json').name + '.js',
path: path.resolve('build'),
library: 'ReactCollapse',
libraryTarget: 'umd'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
})
],
module: {
loaders: [
{test: /\.js$/, loader: babelLoader, include: [path.resolve('src')]}
]
},
resolve: {extensions: ['', '.js']},
stats: {colors: true},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-motion': {
root: 'ReactMotion',
commonjs2: 'react-motion',
commonjs: 'react-motion',
amd: 'react-motion'
},
'react-height': {
root: 'ReactHeight',
commonjs2: 'react-height',
commonjs: 'react-height',
amd: 'react-height'
}
}
};