aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/config/webpack/prod.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/config/webpack/prod.js')
-rw-r--r--app/config/webpack/prod.js50
1 files changed, 25 insertions, 25 deletions
diff --git a/app/config/webpack/prod.js b/app/config/webpack/prod.js
index ef41ab99..44961cc5 100644
--- a/app/config/webpack/prod.js
+++ b/app/config/webpack/prod.js
@@ -5,34 +5,34 @@ const ManifestPlugin = require('webpack-manifest-plugin');
5 5
6const commonConfig = require('./common.js'); 6const commonConfig = require('./common.js');
7 7
8module.exports = function() { 8module.exports = function () {
9 return webpackMerge(commonConfig(), { 9 return webpackMerge(commonConfig(), {
10 output: { 10 output: {
11 filename: '[name].js' 11 filename: '[name].js',
12 }, 12 },
13 devtool: 'source-map', 13 devtool: 'source-map',
14 plugins: [ 14 plugins: [
15 new webpack.DefinePlugin({ 15 new webpack.DefinePlugin({
16 'process.env': { 16 'process.env': {
17 'NODE_ENV': JSON.stringify('production') 17 'NODE_ENV': JSON.stringify('production'),
18 } 18 },
19 }), 19 }),
20 new webpack.optimize.UglifyJsPlugin({ 20 new webpack.optimize.UglifyJsPlugin({
21 beautify: false, 21 beautify: false,
22 mangle: { 22 mangle: {
23 screw_ie8: true, 23 screw_ie8: true,
24 keep_fnames: true 24 keep_fnames: true,
25 }, 25 },
26 compress: { 26 compress: {
27 screw_ie8: true, 27 screw_ie8: true,
28 warnings: false 28 warnings: false,
29 }, 29 },
30 comments: false 30 comments: false,
31 }), 31 }),
32 new ExtractTextPlugin('[name].css'), 32 new ExtractTextPlugin('[name].css'),
33 new ManifestPlugin({ 33 new ManifestPlugin({
34 fileName: 'manifest.json', 34 fileName: 'manifest.json',
35 }) 35 }),
36 ], 36 ],
37 module: { 37 module: {
38 rules: [ 38 rules: [
@@ -48,9 +48,9 @@ module.exports = function() {
48 use: { 48 use: {
49 loader: 'babel-loader', 49 loader: 'babel-loader',
50 options: { 50 options: {
51 presets: ['env'] 51 presets: ['env'],
52 } 52 },
53 } 53 },
54 }, 54 },
55 { 55 {
56 test: /\.(s)?css$/, 56 test: /\.(s)?css$/,
@@ -63,17 +63,17 @@ module.exports = function() {
63 importLoaders: 1, 63 importLoaders: 1,
64 minimize: { 64 minimize: {
65 discardComments: { 65 discardComments: {
66 removeAll: true 66 removeAll: true,
67 }, 67 },
68 core: true, 68 core: true,
69 minifyFontValues: true 69 minifyFontValues: true,
70 } 70 },
71 } 71 },
72 }, 72 },
73 'postcss-loader', 73 'postcss-loader',
74 'sass-loader' 74 'sass-loader',
75 ] 75 ],
76 }) 76 }),
77 }, 77 },
78 { 78 {
79 test: /\.(jpg|png|gif|svg)$/, 79 test: /\.(jpg|png|gif|svg)$/,
@@ -81,8 +81,8 @@ module.exports = function() {
81 loader: 'file-loader', 81 loader: 'file-loader',
82 options: { 82 options: {
83 name: 'img/[name].[ext]', 83 name: 'img/[name].[ext]',
84 } 84 },
85 } 85 },
86 }, 86 },
87 { 87 {
88 test: /\.(eot|ttf|woff|woff2)$/, 88 test: /\.(eot|ttf|woff|woff2)$/,
@@ -90,10 +90,10 @@ module.exports = function() {
90 loader: 'file-loader', 90 loader: 'file-loader',
91 options: { 91 options: {
92 name: 'fonts/[name].[ext]', 92 name: 'fonts/[name].[ext]',
93 } 93 },
94 } 94 },
95 } 95 },
96 ] 96 ],
97 }, 97 },
98 }) 98 });
99}; 99};