Skip to content

Commit

Permalink
temporarily only running 1 test with debugging for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Feb 9, 2021
1 parent 6f79114 commit 96dc431
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/webpack-manifest-plugin/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@ const normalModuleLoaderHook = ({ moduleAssets, assetTypeModuleAssets }, loaderC
// the "emitFile" callback is never called on asset modules
// so, we create a different map that can be used later in the "emit" hook
if (['asset', 'asset/inline', 'asset/resource', 'asset/source'].includes(module.type)) {
Object.assign(assetTypeModuleAssets, {
// This takes the userRequest (which is an absolute path) and turns it into
// a relative path to the root context. This is done so that the string
// will match asset.info.sourceFilename in the emit hook.
[relative(loaderContext.rootContext, module.userRequest)]: basename(
module.userRequest
)
});
let sourceFilename = relative(loaderContext.rootContext, module.userRequest);
// at this point, Windows paths use \ in their paths
// but in the emit hook, asset.info.sourceFilename fill have UNIX slashes
sourceFilename = sourceFilename.replace(/\\/g, '/');
Object.assign(assetTypeModuleAssets, {
[sourceFilename]: basename(module.userRequest),
});
}

// eslint-disable-next-line no-param-reassign
Expand Down

0 comments on commit 96dc431

Please sign in to comment.