examples/webpack/webpack.config.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 24
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 2
dl 0
loc 24
rs 10
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 0
1
var Path = require('path')
2
3
var configuration = {
4
  entry: Path.resolve(__dirname, 'src/script.js'),
5
  output: {
6
    path: Path.resolve(__dirname, 'dist'),
7
    filename: 'script.js'
8
  }
9
}
10
11
if (process.env.NODE_ENV === 'production') {
12
  configuration.module = {
13
    rules: [
14
      {
15
        test: {not: [/script\.js$/]},
16
        use: [
17
          { loader: 'uglify-loader-2' }
18
        ]
19
      }
20
    ]
21
  }
22
}
23
24
module.exports = configuration
25