webpack/production.js   A
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 29
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
wmc 0
c 2
b 0
f 0
nc 1
mnd 0
bc 0
fnc 0
dl 0
loc 29
rs 10
bpm 0
cpm 0
noi 0
1
var path = require('path');
2
var webpack = require('webpack');
3
var HtmlWebpackPlugin = require('html-webpack-plugin');
4
var helpers = require('./helpers');
5
6
var environment = helpers.parseDotenvConfig(
7
  require('dotenv').config(path.resolve(__dirname, '../.env'))
8
);
9
10
module.exports = Object.assign({}, {
11
  plugins: [
12
    new webpack.DefinePlugin(Object.assign({}, {
13
      'process.env.NODE_ENV': '"production"'
14
    }, environment)),
15
    new webpack.ProvidePlugin({
16
      'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
17
    }),
18
    new HtmlWebpackPlugin({
19
      inject: 'body',
20
      template: 'src/main.html'
21
    }),
22
    new webpack.optimize.OccurenceOrderPlugin(),
23
    new webpack.optimize.UglifyJsPlugin({
24
      compressor: {
25
        warnings: false
26
      }
27
    })
28
  ]
29
}, require('./config'));
30