-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
36 lines (35 loc) · 1.03 KB
/
webpack.prod.js
File metadata and controls
36 lines (35 loc) · 1.03 KB
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
35
36
const webpack = require('webpack');
const merge = require('webpack-merge');
var common = require('./webpack.common');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
/*module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader', 'eslint-loader']
}, ]
},*/
devtool: 'source-map',
'plugins': [
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({
title: 'Víctor Valencia - Fullstack Developer',
filename: path.resolve(__dirname, 'index.html'),
template: path.resolve(__dirname, 'src/index.html'),
alwaysWriteToDisk: true
}),
new HtmlWebpackHarddiskPlugin(),
new UglifyJSPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
});