| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 34 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | const url = require('url'); |
||
| 2 | const webpack = require('webpack'); |
||
| 3 | const BrowserSyncPlugin = require('browsersync-webpack-plugin'); |
||
| 4 | |||
| 5 | const config = require('./config'); |
||
| 6 | |||
| 7 | const target = process.env.DEVURL || config.devUrl; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * We do this to enable injection over SSL. |
||
| 11 | */ |
||
| 12 | if (url.parse(target).protocol === 'https:') { |
||
| 13 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; |
||
| 14 | } |
||
| 15 | |||
| 16 | module.exports = { |
||
| 17 | output: { |
||
| 18 | pathinfo: true, |
||
| 19 | publicPath: config.proxyUrl + config.publicPath, |
||
| 20 | }, |
||
| 21 | devtool: '#cheap-module-source-map', |
||
| 22 | stats: false, |
||
| 23 | plugins: [ |
||
| 24 | new webpack.optimize.OccurrenceOrderPlugin(), |
||
| 25 | new webpack.HotModuleReplacementPlugin(), |
||
| 26 | new webpack.NoEmitOnErrorsPlugin(), |
||
| 27 | new BrowserSyncPlugin({ |
||
| 28 | target, |
||
| 29 | proxyUrl: config.proxyUrl, |
||
| 30 | watch: config.watch, |
||
| 31 | delay: 500, |
||
| 32 | }), |
||
| 33 | ], |
||
| 34 | }; |
||
| 35 |