diff --git a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/postcss-cli-resources.ts b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/postcss-cli-resources.ts index 7588d50ec7c1..2f709376f2dd 100644 --- a/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/postcss-cli-resources.ts +++ b/packages/angular_devkit/build_angular/src/angular-cli-files/plugins/postcss-cli-resources.ts @@ -103,7 +103,7 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou const { pathname, hash, search } = url.parse(inputUrl.replace(/\\/g, '/')); const resolver = (file: string, base: string) => new Promise((resolve, reject) => { - loader.resolve(base, file, (err, result) => { + loader.resolve(base, decodeURI(file), (err, result) => { if (err) { reject(err); diff --git a/packages/angular_devkit/build_angular/test/browser/styles2_spec_large.ts b/packages/angular_devkit/build_angular/test/browser/styles2_spec_large.ts index 935c66a20b93..220f9a98548d 100644 --- a/packages/angular_devkit/build_angular/test/browser/styles2_spec_large.ts +++ b/packages/angular_devkit/build_angular/test/browser/styles2_spec_large.ts @@ -575,4 +575,24 @@ describe('Browser Builder styles', () => { const { files } = await browserBuild(architect, host, target, overrides); expect(await files['styles.css']).toContain('background-image:url(//cdn.com/classic-bg.jpg)'); }); + + it('supports fonts with space in filename', async () => { + host.writeMultipleFiles({ + 'src/styles.css': ` + @font-face { + font-family: "Font Awesome"; + src: url("./assets/fa solid-900.woff2") format("woff2"); + } + + body { + font-family: "Font Awesome"; + } + `, + 'src/assets/fa solid-900.woff2': '', + }); + + const overrides = { extractCss: true }; + const { output } = await browserBuild(architect, host, target, overrides); + expect(output.success).toBe(true); + }); });