| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 78 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | var path = require('path') |
||
|
|
|||
| 2 | var webpack = require('webpack') |
||
| 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 | } |
||
| 58 | |||
| 59 | if (process.env.NODE_ENV === 'production') { |
||
| 60 | module.exports.devtool = '#source-map' |
||
| 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 | ]) |
||
| 78 | } |
||
| 79 |
Requirement of semicolons purely is a coding style issue since JavaScript has specific rules about semicolons which are followed by all browsers.
Further Readings: