d3-radarchart
Version:
D3 Radar chart
92 lines (90 loc) • 2.1 kB
JavaScript
;
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
module.exports = {
entry: ['@babel/polyfill', path.join(__dirname, 'src/index.js')],
externals: { react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
}},
mode: 'production',
output: {
path: path.join(__dirname, '/dist/'),
filename: 'index.min.js',
publicPath: '',
libraryTarget: 'umd',
library: 'd3RadarChart'
},
resolve: {
modules: [path.resolve('./src'), path.resolve('./node_modules')]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
output: {
comments: false // remove comments
},
mangle: true,
compress: {
unused: true,
dead_code: true, // big one--strip code that will never execute
warnings: false, // good for prod apps so users can't peek behind curtain
drop_debugger: true,
conditionals: true,
evaluate: true,
drop_console: true, // strips console statements
sequences: true,
booleans: true
}
}
})
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
eslint: {
configFile: '.eslintrc',
failOnWarning: false,
failOnError: false
}
}
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static'
})
],
node: {
fs: 'empty',
net: 'empty',
tls: 'empty',
dns: 'empty'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
enforce: 'pre',
loader: 'eslint-loader'
},
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.json?$/,
loader: 'json-loader'
}
]
}
};