Skip to content

Slow compilation time with large project SASS (migrated from 1.x to 2.x) #5199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
elis opened this issue Oct 1, 2018 · 11 comments
Open

Slow compilation time with large project SASS (migrated from 1.x to 2.x) #5199

elis opened this issue Oct 1, 2018 · 11 comments

Comments

@elis
Copy link

elis commented Oct 1, 2018

I've recently migrated to v2 since I needed the node_module compilation.

I like the auto-magic sass support, but the app takes a minute or two to compile now.

Any suggestions?

Platform: OSX, Node 8, running build/dev via yarn

@elis
Copy link
Author

elis commented Oct 1, 2018

It's worth mentioning that the project would compiled very fast in the previous setup.

@Timer Timer added this to the 2.0.x milestone Oct 1, 2018
@Timer
Copy link
Contributor

Timer commented Oct 1, 2018

Are you talking about a production build or a development mode rebuild?

@gaearon
Copy link
Contributor

gaearon commented Oct 1, 2018

If you mean production build and were previously running a Sass watcher in the background, it doesn't seem like a fair comparison. Because now you're counting it against the build time, but previously by the time the build started, everything was already compiled (and files that didn't need to be built were checked in).

However, we should see if we can somehow cache the DEV Sass build results and reuse them for the production build. That would make a lot of sense since they're not environment-specific.

@Timer
Copy link
Contributor

Timer commented Oct 1, 2018

FWIW, I believe we only having caching on by default for JavaScript. No CSS or Sass -- it's definitely worth exploring this and I was thinking we'd do it as part of #5171.

@willrbc
Copy link

willrbc commented Oct 9, 2018

I'm encountering a similar slowdown, and it's with dev mode rebuild. Any time I edit my _custom.scss or _variables.scss on my bootstrap theme it takes a long time to compile. This is becoming a considerable pain point when trying out different styles.

@iansu iansu modified the milestones: 2.1.x, 3.x Mar 10, 2019
@TDiblik
Copy link

TDiblik commented Feb 10, 2022

Hi, what is a state of this issue? I'm also encoutering, really slow compile times (project with +- 80 files)

@jtsierra
Copy link

It takes me around 5 seconds to run a compile in development mode, which adds up when trying/testing new styles. Most of it comes from react-bootstrap, and I haven't found a way to make it run faster.

Anybody else with the same issue? It is something that I'm missing?

@mattveraldi
Copy link

I have the same problem migrating from node-sass to sass 1.49 (it was a legacy project). So, I don't know if it is strictly related to the 1 to 2 migration. For me it takes several MINUTES to compile.

@gbertl
Copy link

gbertl commented Aug 8, 2022

It takes me around 5 seconds to run a compile in development mode, which adds up when trying/testing new styles. Most of it comes from react-bootstrap, and I haven't found a way to make it run faster.

Anybody else with the same issue? It is something that I'm missing?

have you found solution by now?

@jtsierra
Copy link

jtsierra commented Aug 9, 2022

@gbertl Not because of this, but finally I switched to MaterialUI and started styling all components within themselves (not external sass/css). This turned out to be so much faster.

@gbertl
Copy link

gbertl commented Aug 9, 2022

@jtsierra Hope they fix it soon. I guess I'd take that route too since mine is just a small project. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants