react-inform
Version:
Simple controlled forms with validations in react
46 lines (41 loc) • 817 B
JavaScript
import webpack from 'webpack';
const reactExternal = {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react',
};
const plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
new webpack.optimize.OccurenceOrderPlugin(),
];
if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false,
},
}),
);
}
module.exports = {
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ },
],
},
output: {
library: 'reactInform',
libraryTarget: 'umd',
},
externals: {
react: reactExternal,
},
plugins,
resolve: {
extensions: ['', '.js'],
},
};