Skip to content

Commit c7735ab

Browse files
committed
fix(@angular/cli): copy assets with special character paths
1 parent af5977c commit c7735ab

File tree

1 file changed

+5
-1
lines changed
  • packages/@angular/cli/models/webpack-configs

1 file changed

+5
-1
lines changed

packages/@angular/cli/models/webpack-configs/common.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
121121
asset.glob = asset.glob + '/**/*';
122122
}
123123

124+
// Escape the input in case it has special charaters and use to make glob absolute
125+
const escapedInput = asset.input
126+
.replace(/[\\|\*|\?|\!|\(|\)|\[|\]|\{|\}]/g, (substring) => `\\${substring}`);
127+
124128
return {
125129
context: asset.input,
126130
to: asset.output,
127131
from: {
128-
glob: asset.glob,
132+
glob: path.resolve(escapedInput, asset.glob),
129133
dot: true
130134
}
131135
};

0 commit comments

Comments
 (0)