Skip to content

Commit

Permalink
fix(@angular/cli): copy assets with special character paths
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Jan 11, 2018
1 parent af5977c commit c7735ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,15 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
asset.glob = asset.glob + '/**/*';
}

// Escape the input in case it has special charaters and use to make glob absolute
const escapedInput = asset.input
.replace(/[\\|\*|\?|\!|\(|\)|\[|\]|\{|\}]/g, (substring) => `\\${substring}`);

return {
context: asset.input,
to: asset.output,
from: {
glob: asset.glob,
glob: path.resolve(escapedInput, asset.glob),
dot: true
}
};
Expand Down

0 comments on commit c7735ab

Please sign in to comment.