li.yu
li.yu

Reputation: 21

Angular2: Can I generate style code in a external file , not style element?

Why angular2 generate the style code in the head style element, not an external file.I want to bundle the style code in a bundle.css file, then link it in HTML head.

Upvotes: 1

Views: 41

Answers (1)

Dhaval kansagara
Dhaval kansagara

Reputation: 561

If you are using angular CLI then you can define multiple external style sheet in .angular-cli.json file as follow.

"styles": [
    "styles.css",
    "xyz.css"
  ],

All the file define here will bundle in one single file when you run ng build --prod command.

Upvotes: 1

Related Questions