Completed
Branch vue-create-webpack (d93d8a)
by René
06:31
created

js-src/webpack.config.js   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 78
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 3
dl 0
loc 78
rs 10
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 5
1
var path = require('path')
0 ignored issues
show
Coding Style introduced by
There should be a semicolon.

Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.

Further Readings:

Loading history...
2
var webpack = require('webpack')
0 ignored issues
show
Coding Style introduced by
There should be a semicolon.

Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.

Further Readings:

Loading history...
3
4
module.exports = {
5
  entry: './js-src/init.js',
6
  output: {
7
    path: path.resolve(__dirname, '../js'),
8
    publicPath: '/js/',
9
    filename: 'app-create.js'
10
  },
11
  module: {
12
    rules: [
13
      {
14
        test: /\.css$/,
15
        use: [
16
          'vue-style-loader',
17
          'css-loader'
18
        ],
19
      },      {
20
        test: /\.vue$/,
21
        loader: 'vue-loader',
22
        options: {
23
          loaders: {
24
          }
25
          // other vue-loader options go here
26
        }
27
      },
28
      {
29
        test: /\.js$/,
30
        loader: 'babel-loader',
31
        exclude: /node_modules/
32
      },
33
      {
34
        test: /\.(png|jpg|gif|svg)$/,
35
        loader: 'file-loader',
36
        options: {
37
          name: '[name].[ext]?[hash]'
38
        }
39
      }
40
    ]
41
  },
42
  resolve: {
43
    alias: {
44
      'vue$': 'vue/dist/vue.esm.js'
45
    },
46
    extensions: ['*', '.js', '.vue', '.json']
47
  },
48
  devServer: {
49
    historyApiFallback: true,
50
    noInfo: true,
51
    overlay: true
52
  },
53
  performance: {
54
    hints: false
55
  },
56
  devtool: '#eval-source-map'
57
}
0 ignored issues
show
Coding Style introduced by
There should be a semicolon.

Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.

Further Readings:

Loading history...
58
59
if (process.env.NODE_ENV === 'production') {
60
  module.exports.devtool = '#source-map'
0 ignored issues
show
Coding Style introduced by
There should be a semicolon.

Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.

Further Readings:

Loading history...
61
  // http://vue-loader.vuejs.org/en/workflow/production.html
62
  module.exports.plugins = (module.exports.plugins || []).concat([
63
    new webpack.DefinePlugin({
64
      'process.env': {
65
        NODE_ENV: '"production"'
66
      }
67
    }),
68
    new webpack.optimize.UglifyJsPlugin({
69
      sourceMap: true,
70
      compress: {
71
        warnings: false
72
      }
73
    }),
74
    new webpack.LoaderOptionsPlugin({
75
      minimize: true
76
    })
77
  ])
0 ignored issues
show
Coding Style introduced by
There should be a semicolon.

Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.

Further Readings:

Loading history...
78
}
79