-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.prod.js
34 lines (33 loc) · 864 Bytes
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const path = require('path');
const common = require('./webpack.common');
const { merge } = require('webpack-merge');
const Dotenv = require('dotenv-webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const PACKAGE = require('./package.json');
const version = PACKAGE.version;
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
module.exports = merge(common,{
devtool: 'source-map',
mode:'production',
output: {
path: path.join(__dirname, 'build'),
filename: `bundle-${version}.js`,
},
optimization:{
minimizer: [
new CssMinimizerPlugin(),
]
},
plugins: [
new Dotenv({
path: './.env.production',
safe: true,
allowEmptyValues: true
}),
new HtmlWebpackPlugin({
title:'Import CSV',
template: './public/index.html',
minify: false
})
],
})