Decreasing build times by using lesser number of packages on development?


#1

When I remove packages from my .meteor/packages, the following top grosser decreases dramatically from 7.5s to 5 to 3, depending on the number of packages removed.

| ImportScanner#_findImportedModuleIdentifiers.............7,543 ms (5227)

I have at least 5 packages that I do not need in development (unless testing), and are only required on production. What’s the best way to have 2 .meteor/packages - one for development and one for production, apart from modifying my deploy script to comment those out?


How can I modularize a complex app for faster build times?
#2

update to latest beta, it skips the legacy build


#3

@a.com Thanks. I understand that next release will decrease some time by disabling legacy builds.

But my question is not regarding that. I want to understand if and how we can disable packages in development.


#4

.meteorIgnore maybe?


#5

.meteorIgnore IMO is to ignore certain folders/files during build process. If I put the packages in this file, they will never be added to the build, neither in dev nor prod.


#6

if you can put them into a meteor package then you can use the prodOnly flag

Not sure it will help build times but worth trying perhaps.


#7

Oh nice!
Will definitely try that and report.


#8

Thanks @hexsprite

Definite improvement of ~2s.

New top grosser:

| ImportScanner#_findImportedModuleIdentifiers.............5,906 ms (5223)

I created a new stub package packages/stub/package.js with packages that I do not need on dev:

Package.describe({
	summary: 'prodOnly packages',
	version: '1.0.0',
	name: 'xyz:xyz',
	prodOnly: true,
});

Package.onUse((api) => {
	api.imply('lepozepo:s3');
	api.imply('montiapm:agent');
	api.imply('montiapm:profiler');
	api.imply('percolate:synced-cron');
	api.imply('udondan:jszip');
});

Then I added this package meteor add xyz:xyz and decent improvement. Will try to dig out more on how to reduce the overall 60s that my app takes to build.