UNPKG

react-progressive-graceful-image

Version:
58 lines (56 loc) 1.2 kB
/* globals __dirname */ const webpack = require('webpack'); const path = require('path'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); module.exports = { mode: 'production', entry: path.join(__dirname, 'src/index.js'), externals: [ { react: { root: 'React', commonjs2: 'react', commonjs: 'react', amd: 'react' }, 'react-dom': { root: 'ReactDom', commonjs2: 'react-dom', commonjs: 'react-dom', amd: 'react-dom' } } ], output: { library: 'ReactProgressiveGracefulImage', libraryTarget: 'umd', filename: 'react-progressive-graceful-image.min.js', path: path.join(__dirname, 'umd') }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' } ] }, optimization: { minimizer: [ new UglifyJsPlugin({ uglifyOptions: { warnings: false } }) ] }, plugins: [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }), new webpack.SourceMapDevToolPlugin({ filename: '[file].map' }) ] };