Open dobesv opened 6 years ago
Hello @dobesv are we talking about production here?
No, development.
@dobesv how long does it take to rebuild an app?
It typically takes between 30 and 300 seconds, depending on the machine and other factors that are invisible to me. I recently upgraded my machine so I get 30 seconds rebuilds most of the time. Others on my team are using MacBooks so I think they are looking at 60 seconds on average for a rebuild.
@dobesv this is a lot!
package.json
file?There is a way to speed up building time by installing some NPM packages.
Make sure you have globally and locally installed node-gyp
and node-pre-gyp
.
Hi, there's already some discussion about it in a meteor issue, I think it's a bit separate from this feature request. Sounds like something to do with there being a lot of files in node_modules.
https://github.com/meteor/meteor/issues/9969
How long does it take for meteor to rebuild on your project(s) ?
On Thu, Jun 21, 2018 at 10:09 AM dr.dimitru notifications@github.com wrote:
@dobesv https://github.com/dobesv this is a lot!
- What stack are you on? (Blaze, React, Vue, other)
- Could you post your package.json file?
There is a way to speed up building time by installing some NPM packages. Make sure you have globally and locally installed node-gyp and node-pre-gyp.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/meteor/meteor-feature-requests/issues/303#issuecomment-399176575, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUAmVWXvvCQmsGe5GtMLT5h0iUEXMM1ks5t-9M1gaJpZM4UhF-n .
@dobesv biggest projects is ~10 sec and I'm on old 2012 MBP with SSD, but even SSD is old and not that fast as new macs at all. Small average size almost instant for Client and 1-3 sec for Server rebuild. Including projects where we use TS, Sass, Jade, CoffeeScript - build time usually a bit longer but, still not that long.
Yeah, I don't think it's the number of technologies you use. We must be importing some packages that have a lot of dependencies. Like Apollo, DraftJS, etc.. I don't know exactly which one is the issue.
On Thu, Jun 21, 2018 at 11:55 AM dr.dimitru notifications@github.com wrote:
@dobesv https://github.com/dobesv biggest projects is ~10 sec and I'm on old 2012 MBP with SSD, but even SSD is old and not that fast as new macs at all. Small average size almost instant for Client and 1-3 sec for Server rebuild. Including projects where we use TS, Sass, Jade, CoffeeScript - build time usually a bit longer but, still not that long.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/meteor/meteor-feature-requests/issues/303#issuecomment-399207714, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUAmTLAr9GYhDiDQHd03DzFN220vX2-ks5t--wggaJpZM4UhF-n .
@dobesv it is only true if you're importing NPM packages as source code for further compilation by Meteor (e.g. Babel ES6 -> ES5). Otherwise all NPM packages hanging in node_modules and maybe some of them at bundler-cache.
@dr-dimitru are there different ways of importing npm modules in meteor? I haven't heard of that before.
@dobesv sorry for late reply, yes, many ways:
npm install
module would be left as it is, so in case if ES6/7 used in module, it wouldn't b processed with Babelnpm link
Although Meteor does not recompile packages installed in node_modules
by default, compilation of specific npm packages (for example, to
support older browsers that the package author neglected) can now be
enabled in one of two ways:
Clone the package repository into your application's imports
directory, make any modifications necessary, then use npm install
to
link the-package
into node_modules
:
meteor npm install imports/the-package
Meteor will compile the contents of the package exposed via
imports/the-package
, and this compiled code will be used when you
import the-package
in any of the usual ways:
import stuff from "the-package"
require("the-package") === require("/imports/the-package")
import("the-package").then(...)
This reuse of compiled code is the critical new feature that was added in Meteor 1.7.
Install the package normally with meteor npm install the-package
,
then create a symbolic link to the installed package elsewhere in
your application, outside of node_modules
:
meteor npm install the-package
cd imports
ln -s ../node_modules/the-package .
Again, Meteor will compile the contents of the package because they
are exposed outside of node_modules
, and the compiled code will be
used whenever the-package
is imported from node_modules
.
Note: this technique also works if you create symbolic links to individual files, rather than linking the entire package directory.
In both cases, Meteor will compile the exposed code as if it was part of
your application, using whatever compiler plugins you have installed.
You can influence this compilation using .babelrc
files or any other
techniques you would normally use to configure compilation of
application code. PR #9771
Feature #6
~Note: since compilation of npm packages can now be enabled using the techniques described above, Meteor will no longer automatically scan
node_modules
directories for modules that can be compiled by compiler plugins. If you have been using that functionality to import compiled-to-JS modules fromnode_modules
, you should start using the symlinking strategy instead.~ Follow-up note: this optimization was reverted in Meteor 1.7.0.1 (see above).
It would be great if the server would continue running while rebuilding.
Currently if I make a change, the server stops, so I can't do much testing or messing around in the app until it finishes rebuilding and restarting the server.