fix(@angular/cli): copy assets with special character paths

This commit is contained in:
Charles Lyding 2018-01-04 14:13:14 -05:00 committed by clydin
parent 99b0f9d304
commit b5bac36bf0

View File

@ -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
}
};