Skip to content

Commit

Permalink
fix(infrastructure): Disable webpack-dev-server host checking (#571)
Browse files Browse the repository at this point in the history
Changes introduced in the most recent version of WDS hardened CORS
access to resources. This however breaks our development model when
using proxies like ngrok to test across devices. Because all of our
assets are publicly available, and our WDS usage is purely transient,
I believe it's safe to disable this.
  • Loading branch information
traviskaufman authored May 1, 2017
1 parent 6af47ea commit 023c851
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ module.exports = [{
libraryTarget: 'umd',
library: ['mdc', '[name]'],
},
// See https://github.com/webpack/webpack-dev-server/issues/882
// Because we only spin up dev servers temporarily, and all of our assets are publicly
// available on GitHub, we can safely disable this check.
devServer: {
disableHostCheck: true,
},
devtool: IS_DEV ? 'source-map' : false,
module: {
rules: [{
Expand All @@ -119,6 +125,9 @@ module.exports = [{
libraryTarget: 'umd',
library: 'mdc',
},
devServer: {
disableHostCheck: true,
},
devtool: IS_DEV ? 'source-map' : false,
module: {
rules: [{
Expand Down Expand Up @@ -170,6 +179,9 @@ module.exports = [{
// dummy ".css-entry" extension.
filename: '[name].' + (IS_PROD ? 'min.' : '') + 'css' + (IS_DEV ? '.js' : '-entry'),
},
devServer: {
disableHostCheck: true,
},
devtool: IS_DEV ? 'source-map' : false,
module: {
rules: [{
Expand Down

0 comments on commit 023c851

Please sign in to comment.