Skip to content

Commit c8947d3

Browse files
authored
Merge pull request #4412 from iclanton/fix-windows-issue
Fix an issue where globbing assets from a NPM package would fail on Windows.
2 parents fc76445 + 3546f4f commit c8947d3

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

build-tests/hashed-folder-copy-plugin-webpack5-test/src/index.ts

+12
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ const ASSETS_BASE_URL: string = requireFolder({
1010
]
1111
});
1212

13+
const HEFT_SRC_FILES_BASE_URL: string = requireFolder({
14+
outputFolder: 'heft_src_files_[hash]',
15+
sources: [
16+
{
17+
globsBase: '@rushstack/heft/src',
18+
globPatterns: ['**/*']
19+
}
20+
]
21+
});
22+
1323
function appendImageToBody(url: string): void {
1424
const image: HTMLImageElement = document.createElement('img');
1525
image.src = url;
@@ -25,3 +35,5 @@ appendImageToBody(`${ASSETS_BASE_URL2}/red.png`);
2535
appendImageToBody(`${ASSETS_BASE_URL2}/green.png`);
2636
appendImageToBody(`${ASSETS_BASE_URL2}/blue.png`);
2737
appendImageToBody(`${ASSETS_BASE_URL2}/subfolder/yellow.png`);
38+
39+
console.log(HEFT_SRC_FILES_BASE_URL);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/hashed-folder-copy-plugin",
5+
"comment": "Fix an issue where globbing assets from a NPM package would fail on Windows.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/hashed-folder-copy-plugin"
10+
}

webpack/hashed-folder-copy-plugin/src/HashedFolderDependency.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function _getHashedFolderDependencyForWebpackInstance(webpack: typeof import('we
238238
return renderError(errorMessage);
239239
}
240240

241-
const globResultFullPath: string = path.posix.resolve(resolvedGlobsBase, globResult);
241+
const globResultFullPath: string = path.resolve(resolvedGlobsBase, globResult);
242242

243243
let assetContents: string | Buffer | undefined;
244244
try {

0 commit comments

Comments
 (0)