Tips - how to keep rebuild times fast?

One very frustrating thing about meteor is the reload times between code changes.

I have a small adminUI app and already the reload times are >15 seconds. This is using the METEOR@1.2.2-faster-rebuilds.0 branch which has some speedups implemented.

I’m wondering what can be done / best practices for keeping things reasonable?

Does someone have knowledge of how the faster-rebuilds works internally and any hints on how best to use this?

For example I understand/heard packages are cached. I’m developing inside a package, but does that now mean all packages are rebuilt every time?
In which case, developing new features would be better done inside the app itself, and then packaging up when the code is reasonably stable?

Other ideas:

  • ripping out any css preprocessors (stylus) or CSS libraries? OK to develop with an ugly UI and add that stuff back in later. Any effect?

  • develop code in isolated packages as much as possible, and disabling packages when they’re not needed (not much effect if they are cached though). I didn’t notice this making much change, and perhaps meteor build is still looking through everything in your app/packages/ directory even when they’re not included in the .meteor/packages file.

  • can any meteor 1st party packages be pre-built (React etc) or adding these also drags down build time?

Combined with the lack of an effective way to do TDD with meteor, the slow builds are a productivity killer that defeats the purpose of meteor in the first place, so any tips or profiling people have done to keep builds fast would be great to know.

1 Like

You can start meteor with METEOR_PROFILE=1 meteor to see where most time is spent.

Actions that we currently take to solve the same issues you have:

  • Use webpack:webpack
  • Use Wallaby for writing unit tests. We are stubbing Meteor and other external dependencies for this unit tests. We also use ES2015 modules for explicit dependencies between files. So we basically bypass the whole Meteor build system for this and don’t load the whole app for those tests. This results in instant feedback. We will soon publish this as part of
1 Like