Skip to content

Commit 5e1b378

Browse files
alan-agius4vikerman
authored andcommitted
fix(@angular-devkit/build-angular): fix permission errors for ES5 bundles
copyFilesSync will also copy permissions which may result in permissions errors. Closes #15490
1 parent b26d6ba commit 5e1b378

File tree

1 file changed

+5
-0
lines changed
  • packages/angular_devkit/build_angular/src/browser

1 file changed

+5
-0
lines changed

packages/angular_devkit/build_angular/src/browser/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ export function buildWebpackBrowser(
473473

474474
for (const action of cacheActions) {
475475
fs.copyFileSync(action.src, action.dest, fs.constants.COPYFILE_FICLONE);
476+
if (process.platform !== 'win32') {
477+
// The cache writes entries as readonly and when using copyFile the permissions will also be copied.
478+
// See: https://github.com/npm/cacache/blob/073fbe1a9f789ba42d9a41de7b8429c93cf61579/lib/util/move-file.js#L36
479+
fs.chmodSync(action.dest, 0o644);
480+
}
476481
}
477482

478483
if (processActions.length > 0) {

0 commit comments

Comments
 (0)