0

i have a question regarding the importation of the same scss file in different composents, for instance bootstrap scss file from the node module, Will it compile it as a single file or Will it duplicate it depanding on the number of composent that i imported in ?

Thanks

Zetsuu
  • 37
  • 1
  • 6

2 Answers2

0

No, Angular will not duplicate any files but simply reference the same file. I can't really find any references to back up this claim exactly, but I have never heard of file duplication with any compiler, more so, that would be very inefficient. Take a look at this SOF question which may help you.

ViqMontana
  • 5,090
  • 3
  • 19
  • 54
0

You are importing bootstrap in several components. It means you have kept bootstrap file either in assets and just passing in index.html as

<link href="...." rel="stylesheet">

or,

npm install --save bootstrap

angular.json

styles:[
"node_modules/scss/bootstrap.scss"
]

So, by importing each time in several components , it is compiling it as a single file. However, it is referencing bootstrap file each time.

Mahi
  • 3,748
  • 4
  • 35
  • 70