myasonik / kibana-skeleton

CRA-skeleton version of Kibana
3 stars 7 forks source link

sass files are slow #7

Open myasonik opened 3 years ago

myasonik commented 3 years ago

If using sass index file, everything works well.

If nesting sass files, compile times shoot up to ~30s.

myasonik commented 3 years ago

Seems like the issue is that EUI is just too big. Moving EUI compilation into its own build step should help.

Can copy from this PR: https://github.com/elastic/elastic-docs-next/pull/20 (includes some irrelevant changes as well around theme management that we can ignore)

cchaos commented 3 years ago

This is because you're actually rebuilding ALL EUI styles by importing the SASS file. The only reason you would need to do this is if you're altering top-level theme variables like $euiColorPrimary. But since you aren't, you'll want to import the compiled .css file in your App.js.

https://github.com/elastic/eui/blob/master/wiki/consuming.md#importing-compiled-css