New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): ignore @import in comments #13368
Conversation
2545132
to
3b02775
Compare
it('should ignore "@import" in comments', () => { | ||
const css = '/*@import "foo!"*/'; | ||
const styleWithImports = extractStyleUrls(urlResolver, 'http://ng.io', css); | ||
expect(styleWithImports.style.trim()).toEqual(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test should be:
expect(...).toContain(nonCommentedImport);
expect(...).not.toContain(commentedImport);
Also please you PR two commits:
- refactor,
- fix.
Thanks
// remove comments | ||
cssText = cssText.replace(CSS_COMMENT_REGEXP, ''); | ||
|
||
const modifiedCssText = cssText.replace(CSS_IMPORT_REGEXP, (...m: string[]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also chain replace
935fbb1
to
45bea22
Compare
@vicb comments are addressed |
45bea22
to
e09af61
Compare
@vicb ping |
Thanks ! |
* refactor(compiler): clean up style url resolver * fix(compiler): ignore @import in css comments Closes angular#12196
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #12196