forked from mazipan/vue-currency-filter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
50 lines (47 loc) · 1001 Bytes
/
webpack.config.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const CompressionPlugin = require("compression-webpack-plugin")
const NODE_ENV = process.env.NODE_ENV;
const setPath = function(folderName) {
return path.join(__dirname, folderName);
}
const config = {
entry: {
app: './VueCurrencyFilter.js'
},
output: {
filename: "VueCurrencyFilter.bundle.js",
libraryTarget: 'commonjs2'
},
optimization:{
runtimeChunk: false
},
resolveLoader: {
modules: [setPath('node_modules')]
},
mode: 'production',
plugins: [
new webpack.DefinePlugin({
'process.env': {
isStaging: (NODE_ENV === 'development'),
NODE_ENV: '"'+NODE_ENV+'"'
}
}),
new CompressionPlugin({
algorithm: 'gzip'
})
],
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: [{
loader: "babel-loader"
}]
}
]
}
};
module.exports = config;