Skip to content

Commit

Permalink
convert error into warning
Browse files Browse the repository at this point in the history
when using dev-server and an absolute URL for publicPath
to get webpack encore working in docker environment
  • Loading branch information
robertfausk authored and weaverryan committed Jul 21, 2017
1 parent 4ad8d88 commit 910b6bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/WebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

'use strict';

const chalk = require('chalk');
const path = require('path');
const fs = require('fs');

Expand Down Expand Up @@ -94,7 +95,8 @@ class WebpackConfig {
*/
if (publicPath.includes('://')) {
if (this.useDevServer()) {
throw new Error('You cannot pass an absolute URL to setPublicPath() and use the dev-server at the same time. Try using Encore.isProduction() to only configure your absolute publicPath for production.');
console.log(chalk.bgYellow.black(' WARNING ') + chalk.yellow(' You should not pass an absolute URL to setPublicPath() and use the dev-server at the same time'));
console.log();
}
} else {
if (publicPath.indexOf('/') !== 0) {
Expand Down

0 comments on commit 910b6bc

Please sign in to comment.