Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf1304b3

Browse files
clydinfilipesilva
authored andcommitted
fix(@angular/cli): prevent greedy CSS url function capture
1 parent3ba6cd8 commitf1304b3

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

‎packages/@angular/cli/plugins/postcss-cli-resources.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default postcss.plugin('postcss-cli-resources', (options: PostcssCliResou
121121

122122
returnPromise.all(urlDeclarations.map(asyncdecl=>{
123123
constvalue=decl.value;
124-
consturlRegex=/url\(\s*(?:"([^"]+)"|'([^']+)'|(.+))\s*\)/g;
124+
consturlRegex=/url\(\s*(?:"([^"]+)"|'([^']+)'|(.+?))\s*\)/g;
125125
constsegments:string[]=[];
126126

127127
letmatch;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import{silentNpm,ng}from'../../utils/process';
2+
import{updateJsonFile}from'../../utils/project';
3+
import{expectFileToMatch}from'../../utils/fs';
4+
5+
6+
exportdefaultfunction(){
7+
returnPromise.resolve()
8+
.then(()=>silentNpm('install','material-design-icons@3.0.1'))
9+
.then(()=>updateJsonFile('.angular-cli.json',configJson=>{
10+
constapp=configJson['apps'][0];
11+
app['styles'].push('../node_modules/material-design-icons/iconfont/material-icons.css');
12+
}))
13+
.then(()=>ng('build','--extract-css'))
14+
.then(()=>expectFileToMatch('dist/styles.bundle.css','Material Icons'))
15+
.then(()=>ng(
16+
'build',
17+
'--prod',
18+
'--extract-css',
19+
'--output-hashing=none'
20+
))
21+
.then(()=>expectFileToMatch('dist/styles.bundle.css','Material Icons'));
22+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp