storybook/scripts/webpack.manager.conf.js
2016-06-03 12:23:24 -05:00

37 lines
999 B
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var path = require('path');
var webpack = require('webpack');
var plugins = [];
// When we run `npm run dev`, we don't need to include these production
// optimizations. That's why we do this.
if (!process.env.DEV_BUILD) {
plugins = plugins.concat([
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
}),
]);
}
module.exports = {
devtool: '#cheap-module-source-map',
  entry: path.resolve(__dirname, '../src/client/manager/index.js'),
  output: { path: path.resolve(__dirname, '../dist'), filename: 'manager.js' },
plugins: plugins,
  module: {
    loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: path.resolve(__dirname, '../node_modules/'),
query: {
presets: ['es2015', 'react', 'stage-0']
}
}
]
  },
};