Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hashed-folder-copy-plugin] Fix an issue where globbing assets from a NPM package would fail on Windows. #4412

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ const ASSETS_BASE_URL: string = requireFolder({
]
});

const HEFT_SRC_FILES_BASE_URL: string = requireFolder({
outputFolder: 'heft_src_files_[hash]',
sources: [
{
globsBase: '@rushstack/heft/src',
globPatterns: ['**/*']
}
]
});

function appendImageToBody(url: string): void {
const image: HTMLImageElement = document.createElement('img');
image.src = url;
Expand All @@ -25,3 +35,5 @@ appendImageToBody(`${ASSETS_BASE_URL2}/red.png`);
appendImageToBody(`${ASSETS_BASE_URL2}/green.png`);
appendImageToBody(`${ASSETS_BASE_URL2}/blue.png`);
appendImageToBody(`${ASSETS_BASE_URL2}/subfolder/yellow.png`);

console.log(HEFT_SRC_FILES_BASE_URL);
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/hashed-folder-copy-plugin",
"comment": "Fix an issue where globbing assets from a NPM package would fail on Windows.",
"type": "patch"
}
],
"packageName": "@rushstack/hashed-folder-copy-plugin"
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function _getHashedFolderDependencyForWebpackInstance(webpack: typeof import('we
return renderError(errorMessage);
}

const globResultFullPath: string = path.posix.resolve(resolvedGlobsBase, globResult);
const globResultFullPath: string = path.resolve(resolvedGlobsBase, globResult);

let assetContents: string | Buffer | undefined;
try {
Expand Down
Loading