mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1880586 - Fix newtab webpack resource URI discrepancy on Windows. r=omc-reviewers,emcminn,thecount
Differential Revision: https://phabricator.services.mozilla.com/D202031
This commit is contained in:
parent
851c438cd5
commit
c153967051
@ -6,6 +6,8 @@
|
||||
// and translating the uri into a relative filesytem path where the file may be
|
||||
// found when running within the Karma / Mocha test framework.
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
ResourceUriPlugin: class ResourceUriPlugin {
|
||||
/**
|
||||
@ -48,7 +50,12 @@ module.exports = {
|
||||
if (!url.href.match(regex)) {
|
||||
continue;
|
||||
}
|
||||
const pathname = url.href.replace(regex, replacement);
|
||||
// path.join() is necessary to normalize the path on Windows.
|
||||
// Without it, the path may contain backslashes, resulting in
|
||||
// different build output on Windows than on Unix systems.
|
||||
const pathname = path.join(
|
||||
url.href.replace(regex, replacement)
|
||||
);
|
||||
resourceData.path = pathname;
|
||||
resourceData.query = url.search;
|
||||
resourceData.fragment = url.hash;
|
||||
|
Loading…
Reference in New Issue
Block a user