We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent baf68d8 commit baa350dCopy full SHA for baa350d
webpack.config.babel.js
@@ -1,13 +1,24 @@
1
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
+}
12
13
export default {
14
entry: path.resolve(__dirname, 'lib/index.js'),
15
output: {
16
path: path.join(__dirname, 'dist'),
- filename: 'react-sortable.js',
17
+ filename: env === 'dist' ? 'react-sortable.min.js' : 'react-sortable.js',
18
libraryTarget: 'umd',
19
library: 'SortableMixin'
20
},
21
+ plugins: plugins,
22
externals: {
23
'react': {
24
root: 'React',
0 commit comments