-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.prod.js
37 lines (35 loc) · 1.17 KB
/
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
35
36
37
var webpack = require("webpack");
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const MinifyPlugin = require('babel-minify-webpack-plugin');
var CompressionPlugin = require('compression-webpack-plugin');
var settings = {
bundleName: "bundle_prod.js",
apiURL: "https://marketplace.chicagomaroon.com/",
rootURL: "",
fbAppID: "155579525119529",
s3URL: "https://s3.us-east-2.amazonaws.com/maroon-marketplace"
};
module.exports = merge(common, {
output: {
filename: settings.bundleName
},
plugins: [
new webpack.DefinePlugin({
"API_URL": JSON.stringify(settings.apiURL),
"ROOT_URL": JSON.stringify(settings.rootURL),
"FB_APP_ID": JSON.stringify(settings.fbAppID),
"S3_URL": JSON.stringify(settings.s3URL)
}),
new MinifyPlugin(),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new CompressionPlugin({
asset: "[path].gz[query]",
algorithm: "gzip",
test: /\.js$|\.css$|\.html$/,
threshold: 10240,
minRatio: 0.8
})
]
});