Skip to content

Commit

Permalink
Add environment specific configs for webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh committed Mar 22, 2017
1 parent d292cd1 commit 28dc0bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webpack.config.js
@@ -1,23 +1,27 @@
const path = require('path');
const webpack = require('webpack');
const env = process.env.NODE_ENV || 'development';
const __DEV__ = env === 'development';
const __PROD__ = env === 'production';

module.exports = {
entry: './src/es5-gfycat-sdk',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'gfycat-sdk.umd.bundle.min.js',
filename: __DEV__ ? 'gfycat-sdk.umd.bundle.js' : 'gfycat-sdk.umd.bundle.min.js',
publicPath: '/assets/',
library: 'GfycatSDK',
libraryTarget: 'umd'
},
devtool: 'source-map',
target: 'web',
plugins: [
plugins: __PROD__ ? [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: false
}
})
]
] : [],
watch: __DEV__
};

0 comments on commit 28dc0bc

Please sign in to comment.