Skip to content

Commit 96dc431

Browse files
committed
temporarily only running 1 test with debugging for Windows
1 parent 6f79114 commit 96dc431

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/webpack-manifest-plugin/hooks.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ const normalModuleLoaderHook = ({ moduleAssets, assetTypeModuleAssets }, loaderC
119119
// the "emitFile" callback is never called on asset modules
120120
// so, we create a different map that can be used later in the "emit" hook
121121
if (['asset', 'asset/inline', 'asset/resource', 'asset/source'].includes(module.type)) {
122-
Object.assign(assetTypeModuleAssets, {
123122
// This takes the userRequest (which is an absolute path) and turns it into
124123
// a relative path to the root context. This is done so that the string
125124
// will match asset.info.sourceFilename in the emit hook.
126-
[relative(loaderContext.rootContext, module.userRequest)]: basename(
127-
module.userRequest
128-
)
129-
});
125+
let sourceFilename = relative(loaderContext.rootContext, module.userRequest);
126+
// at this point, Windows paths use \ in their paths
127+
// but in the emit hook, asset.info.sourceFilename fill have UNIX slashes
128+
sourceFilename = sourceFilename.replace(/\\/g, '/');
129+
Object.assign(assetTypeModuleAssets, {
130+
[sourceFilename]: basename(module.userRequest),
131+
});
130132
}
131133

132134
// eslint-disable-next-line no-param-reassign

0 commit comments

Comments
 (0)