table-filter-multiselect
Version:
## Install You need to have react and react-dom as dependencies in your project.
65 lines (64 loc) • 1.4 kB
JavaScript
var path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require('webpack');
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'lib'),
library: 'tableFilterMultiselect',
libraryTarget: 'umd'
},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
}
},
module: {
rules: [
{
test: /\.js$/,
// exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
// use: ['css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass-loader']
use: ['css-loader', 'sass-loader']
})
}
]
},
plugins: [
new webpack.DefinePlugin({ // <-- key to reducing React's size
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new ExtractTextPlugin({
filename: 'styles.css',
disable: false,
allChunks: true
}),
new webpack.optimize.UglifyJsPlugin({
drop_console: true
}),
new webpack.optimize.AggressiveMergingPlugin()//Merge chunks
]
};