2019-01-09 03:06:21 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2019-01-10 21:51:14 +03:00
|
|
|
module.exports = (env = {}) => ({
|
|
|
|
mode: 'production',
|
|
|
|
entry: {
|
2020-08-08 23:26:39 +03:00
|
|
|
app: ['./src/index.js'],
|
2019-01-10 21:51:14 +03:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
library: 'd3tooltip',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2020-08-08 23:26:39 +03:00
|
|
|
filename: env.minimize ? 'd3tooltip.min.js' : 'd3tooltip.js',
|
2019-01-10 21:51:14 +03:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel-loader',
|
2020-08-08 23:26:39 +03:00
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
2019-01-10 21:51:14 +03:00
|
|
|
},
|
|
|
|
optimization: {
|
2020-08-08 23:26:39 +03:00
|
|
|
minimize: !!env.minimize,
|
2019-01-10 21:51:14 +03:00
|
|
|
},
|
|
|
|
performance: {
|
2020-08-08 23:26:39 +03:00
|
|
|
hints: false,
|
|
|
|
},
|
2019-01-10 21:51:14 +03:00
|
|
|
});
|