forked from huridocs/uwazi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
38 lines (35 loc) · 1.16 KB
/
webpack.production.config.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
/* eslint-disable */
'use strict';
process.env.NODE_ENV = 'production';
var path = require('path');
var webpack = require('webpack');
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const CopyWebpackPlugin = require("copy-webpack-plugin");
var production = true;
var config = require('./webpack/config')(production);
config.devtool = 'cheap-module-source-map';
config.context = __dirname;
config.mode = 'development';
config.resolveLoader = {
modules: ["node_modules", __dirname + "/webpack/webpackLoaders"],
extensions: [".js", ".json"],
mainFields: ["loader", "main"]
},
config.module.rules.push({
test: /world-countries/,
loader: "country-loader"
})
config.plugins = config.plugins.concat([
new CopyWebpackPlugin([
{ from: "node_modules/react-flags/vendor/flags", to: "flags" }
]),
new webpack.optimize.OccurrenceOrderPlugin(),
new OptimizeCssAssetsPlugin(),
new UglifyJSPlugin({
parallel: true,
}),
new webpack.optimize.AggressiveMergingPlugin(),
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } })
])
module.exports = config;