diff --git a/packages/@angular/cli/plugins/postcss-cli-resources.ts b/packages/@angular/cli/plugins/postcss-cli-resources.ts index deae78cf5140..7cd00695048d 100644 --- a/packages/@angular/cli/plugins/postcss-cli-resources.ts +++ b/packages/@angular/cli/plugins/postcss-cli-resources.ts @@ -121,7 +121,7 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou return Promise.all(urlDeclarations.map(async decl => { const value = decl.value; - const urlRegex = /url\(\s*(?:"([^"]+)"|'([^']+)'|(.+))\s*\)/g; + const urlRegex = /url\(\s*(?:"([^"]+)"|'([^']+)'|(.+?))\s*\)/g; const segments: string[] = []; let match; diff --git a/tests/e2e/tests/third-party/material-icons.ts b/tests/e2e/tests/third-party/material-icons.ts new file mode 100644 index 000000000000..8e7d6b7ba156 --- /dev/null +++ b/tests/e2e/tests/third-party/material-icons.ts @@ -0,0 +1,22 @@ +import {silentNpm, ng} from '../../utils/process'; +import {updateJsonFile} from '../../utils/project'; +import {expectFileToMatch} from '../../utils/fs'; + + +export default function() { + return Promise.resolve() + .then(() => silentNpm('install', 'material-design-icons@3.0.1')) + .then(() => updateJsonFile('.angular-cli.json', configJson => { + const app = configJson['apps'][0]; + app['styles'].push('../node_modules/material-design-icons/iconfont/material-icons.css'); + })) + .then(() => ng('build', '--extract-css')) + .then(() => expectFileToMatch('dist/styles.bundle.css', 'Material Icons')) + .then(() => ng( + 'build', + '--prod', + '--extract-css', + '--output-hashing=none' + )) + .then(() => expectFileToMatch('dist/styles.bundle.css', 'Material Icons')); +}