Use --extra-packages to Add a Package in Production Only?

I want to use Meteor package mdg:meteor-apm-agent in production, but not in development. I removed it from my development build. It seems like I can add it into my Galaxy production build using -extra-packages like this:

npx browserslist@latest --update-db && DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy www.myWebApp.com --settings ./settings.json --extra-packages mdg:meteor-apm-agent

Is there any reason this would not be good practice?

Any potential errors/bugs/conflicts with that package will not be caught during development/testing/CI

1 Like

2 Likes

What is the best practices approach for setting "isDisabled":true for development only? I could have two settings.json files of course and pick one via --settings settings.json.

Was thinking of the same, two files.

1 Like

Yes, 1 file for each environment. At least, this is the way that we do it.

You can add an alias on your package.json for each one, something like start:dev and start:prod

Given that the --settings approach requires having two separate settings.json files, would it be easier to use the --extra-packages approach in this case?