Skip to content

Commit f21524c

Browse files
author
Diabeu
committed
fix(index): add styleUrlsRegex to properly replace
1 parent b8e3427 commit f21524c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const moduleIdRegex = /moduleId\s*:(.*)/g;
1010
const componentRegex = /@Component\(\s?{([\s\S]*)}\s?\)$|type:\s?Component,\s?args:\s?\[\s?{([\s\S]*)},\s?\]/gm;
1111
const commentRegex = /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm; // http://www.regextester.com/?fam=96247
1212
const templateUrlRegex = /templateUrl\s*:(.*)/g;
13-
const styleUrlsRegex = /styleUrls\s*:(\s*\[[\s\S]*?\])/g;
13+
const styleUrlsRegex = /styleUrls\s*:(\s*\[[\s\S]*?\])/g; // http://www.regextester.com/?fam=98594
1414
const stringRegex = /(['"`])((?:[^\\]\\\1|.)*?)\1/g;
1515

1616
function insertText(str, dir, preprocessor = res => res, processFilename = false, sourceType = 'ts') {
@@ -76,7 +76,7 @@ export default function angular(options = {}) {
7676
/* replace styles in files generated by ngc */
7777
if (fileExt === 'js') {
7878
replace({
79-
regex: match,
79+
regex: styleUrlsRegex,
8080
replacement: toReplace,
8181
paths: [map],
8282
recursive: true,

0 commit comments

Comments
 (0)