diff --git a/packages/@angular/cli/models/webpack-configs/common.ts b/packages/@angular/cli/models/webpack-configs/common.ts index 263d428e61a7..a279b3c96048 100644 --- a/packages/@angular/cli/models/webpack-configs/common.ts +++ b/packages/@angular/cli/models/webpack-configs/common.ts @@ -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 } };