meteor-scss icon indicating copy to clipboard operation
meteor-scss copied to clipboard

How to improve build performance

Open lorensr opened this issue 7 years ago • 5 comments

According to METEOR_PROFILE=1 meteor run, my app takes 30 seconds to rebuild with this package and 22 seconds without it. Is there any way the performance can be improved? Either in the package code, or by my use of it? Right now I'm doing individual-component JS imports, eg import './Post.scss' inside /imports/Post.js. Would it be better if I moved all my SCSS into one file, or if I switched from JS imports to SCSS imports? (@import '{}/imports/Post.scss' inside client/styles.scss)?

meteor version: 1.7.0.1

fourseven:scss version: 4.9.0

lorensr avatar Jul 11 '18 20:07 lorensr

It might be because you have a lot of scss files in your node_modules which get compiled unnecessary. Could you try if it's better with meteor 1.7 instead of 1.7.0.1? If so, that's because there was an optimization for this in 1.7 that had to be reverted and will be re-introduced in 1.7.1.

Other than that I don't think there's much we can do since we already use meteor's caching system and basically just pass the files to node-sass which uses libsass and is already the fastest way.

sebakerckhof avatar Jul 11 '18 21:07 sebakerckhof

Thanks! 1.7 takes it down to 26.5s.

a lot of scss files in your node_modules which get compiled unnecessary

Do all .scss files inside node_modules/ get compiled, or only those I import?

On Wed, Jul 11, 2018 at 5:14 PM Seba Kerckhof [email protected] wrote:

It might be because you have a lot of scss files in your node_modules which get compiled unnecessary. Could you try if it's better with meteor 1.7 instead of 1.7.0.1? If so, that's because there was an optimization for this in 1.7 that had to be reverted and will be re-introduced in 1.7.1.

Other than that I don't think there's much we can do since we already use meteor's caching system and basically just pass the files to node-sass which uses libsass and is already the fastest way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fourseven/meteor-scss/issues/276#issuecomment-404311352, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPVmBA3YIb_Bz6SnuAjxxVnsBJ5XrSDks5uFmqXgaJpZM4VL0LZ .

lorensr avatar Jul 11 '18 21:07 lorensr

in 1.7.0.1 it's all of them. Meteor 1.7.1 will have an optimization to only compile the once you import. See: https://github.com/meteor/meteor/pull/9983

sebakerckhof avatar Jul 11 '18 22:07 sebakerckhof

Meteor 1.7 also only uses the once you import, but using another technique which fails in some scenarios. Hence why 1.7.0.1 was introduced to revert this optimization. If you don't experience any build errors, it's safe to stay on 1.7 until 1.7.1 is released.

sebakerckhof avatar Jul 11 '18 22:07 sebakerckhof

what about the new api mentioned here? https://github.com/meteor/meteor/blob/30df020c9ddf8c62d2c49d7829cfe661aa9699eb/History.md

macrozone avatar Jul 25 '18 21:07 macrozone