Enable HTML injection over SSL

This commit is contained in:
QWp6t
2017-03-29 01:31:55 -07:00
parent d91cabff58
commit 038de19e68
3 changed files with 53 additions and 49 deletions

View File

@@ -1,8 +1,18 @@
const url = require('url');
const webpack = require('webpack');
const BrowserSyncPlugin = require('browsersync-webpack-plugin');
const config = require('./config');
const target = process.env.DEVURL || config.devUrl;
/**
* We do this to enable injection over SSL.
*/
if (url.parse(target).protocol === 'https:') {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
}
module.exports = {
output: {
pathinfo: true,
@@ -15,7 +25,7 @@ module.exports = {
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new BrowserSyncPlugin({
target: process.env.DEVURL || config.devUrl,
target,
proxyUrl: config.proxyUrl,
watch: config.watch,
delay: 500,