Skip to content

Commit baa350d

Browse files
committed
Output multiple files
1 parent baf68d8 commit baa350d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

webpack.config.babel.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import path from 'path';
2+
import webpack from 'webpack';
3+
4+
const env = process.env.BUILD_ENV;
5+
let plugins = [];
6+
7+
if (env === 'dist') {
8+
plugins = plugins.concat([
9+
new webpack.optimize.UglifyJsPlugin({ minimize: true })
10+
]);
11+
}
212

313
export default {
414
entry: path.resolve(__dirname, 'lib/index.js'),
515
output: {
616
path: path.join(__dirname, 'dist'),
7-
filename: 'react-sortable.js',
17+
filename: env === 'dist' ? 'react-sortable.min.js' : 'react-sortable.js',
818
libraryTarget: 'umd',
919
library: 'SortableMixin'
1020
},
21+
plugins: plugins,
1122
externals: {
1223
'react': {
1324
root: 'React',

0 commit comments

Comments
 (0)