Element: [Bug Report] very slow compile of scss files

Created on 7 May 2018  ·  4Comments  ·  Source: ElemeFE/element

Element UI version

0.1.0

OS/Browsers version

osx / chrome

Vue version

2.5.16

Steps to reproduce

i have been noticing that compile time is taking 10-15 s or more when i @import the element SCSS files.
i am using the vuejs webpack template as my webpack config / compiler. But i have noticed it also on a bare min webpack config.
When the compiler first runs it does it in a good time. But when i have doing npm run dev and it recompiles after a file is changed; after the 2nd or 3rd time it starts to get very very slow to compile the element scss files..

Most helpful comment

Can this issue be reopened? Did someone find a workaround? Thanks.

All 4 comments

I couldn't reproduce this. Here's what I did:

  • use [email protected] to initiate a project
  • install Element and import its SCSS file instead of compiles CSS file
  • npm run dev
  • change a line in a .vue file
  • wait about 2 - 3 seconds, the change takes effect

Repeat step 4, and it didn't take longer time to compile.

Is it because your app itself is too large? If not, please write a demo (can be a GitHub repo) and open a new issue with it.

@Leopoldthecoder This does not happen with Vue files but SCSS files. If you import element UI with chalk theme, compilation of the SCSS takes more than 12 seconds. I try not to change styles as much as possible now because it just takes too much time.

@Leopoldthecoder importing "~element-ui/packages/theme-chalk/src/index"; as described in the instructions adds 12+ seconds to the compile time which can be seen when updating scss files, such as the element-variables.scss file, and not when changing .vue files as you tested.

Can this issue be reopened? Did someone find a workaround? Thanks.

Was this page helpful?
0 / 5 - 0 ratings