-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #96 Relaxed public path requirements with dev-server (robertf…
…ausk, weaverryan) This PR was merged into the master branch. Discussion ---------- Relaxed public path requirements with dev-server Fixes #59 and finishes #66. * Adds a new `--keep-public-path` option for `dev-server`. When used, your `publicPath` is not prefixed with the dev server URL. For #59, this means you can use `setPublicPath('/build')` with the dev-server, and your assets will remain local (i.e. `/build/main.js` instead of `http://localhost:8080/build/main.js`). * It is now possible to pass an absolute URL to `setPublicPath()` without an error when using `dev-server`. But, we issue a big warning, because this means your assets will point to to that absolute URL, instead of to the dev-server (which for most setups, is not what you want). @samjarrett I'd love to confirm that this would solve your issue in Docker :). Commits ------- 4bc1e19 Using real public path, though it doesn't look like it matters 92e22af Allowing an absolute publicPath with dev-server, but showing a warning 830fdb5 Adding --keep-public-path to dev-server to allow you to fully control the publicPath b27f7c9 Reversing some of the changes we won't do for now, and adding the failing test e206a12 fix issue in generated public path of manifest.json eb5565b convert error into warning 910b6bc convert error into warning
- Loading branch information
Showing
11 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const chalk = require('chalk'); | ||
let isVerbose = false; | ||
let quiet = false; | ||
let messages = { | ||
debug: [], | ||
warning: [], | ||
}; | ||
|
||
function log(message) { | ||
if (quiet) { | ||
return; | ||
} | ||
|
||
console.log(message); | ||
} | ||
|
||
module.exports = { | ||
debug(message) { | ||
messages.debug.push(message); | ||
|
||
if (isVerbose) { | ||
log(`${chalk.bgBlack.white(' DEBUG ')} ${message}`); | ||
} | ||
}, | ||
|
||
warning(message) { | ||
messages.warning.push(message); | ||
|
||
log(`${chalk.bgYellow.black(' WARNING ')} ${chalk.yellow(message)}`); | ||
}, | ||
|
||
clearMessages() { | ||
messages.debug = []; | ||
messages.warning = []; | ||
}, | ||
|
||
getMessages() { | ||
return messages; | ||
}, | ||
|
||
quiet() { | ||
quiet = true; | ||
}, | ||
|
||
verbose() { | ||
isVerbose = true; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters