UNPKG

react-inline-date

Version:
50 lines (49 loc) 977 B
var path = require('path'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); var HtmlWebpackPlugin = require('html-webpack-plugin'); var webpack = require('webpack'); module.exports = { entry: './src/index.js', mode: 'production', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'lib'), library: 'inlineDate', 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$/, use: { loader: 'babel-loader', options: { presets: ['env'] } } } ] }, plugins: [ new webpack.DefinePlugin({ // <-- key to reducing React's size 'process.env': { 'NODE_ENV': JSON.stringify('production') } }), new webpack.optimize.AggressiveMergingPlugin()//Merge chunks ] };