0

I'm using the angular cli with styles added to each component using the styleUrls link

When testing locally this seems to output <style> tags to the head of the document

Does Angular output a <style> tag for each component with style added with styleUrls

If it does is this locally or will this be the case in production.

3
  • ng build --prod and check what is built Commented Sep 11, 2018 at 10:29
  • What does ng build --prod do Commented Sep 11, 2018 at 10:39
  • Builds for production ?? Commented Sep 11, 2018 at 10:45

1 Answer 1

0

It does this in production as well, but only once for each type of component. E.g. if you have 100 components in an *ngFor, it will only insert the styles for them all once. This is how they scope styles to only apply to the elements within that component's template.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.