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

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?

update to latest beta, it skips the legacy build 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.

.meteorIgnore maybe?

.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.

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.

1 Like

Oh nice!
Will definitely try that and report.

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:

	summary: 'prodOnly packages',
	version: '1.0.0',
	name: 'xyz:xyz',
	prodOnly: true,

Package.onUse((api) => {

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.

1 Like