How to force parcel watch to use the same config as parcel build (minification, tree-shaking)?

Question

Is there an option or config to make parcel generate the same output as parcel build when using parcel watch ?

I want minification, tree-shaking etc to also occur in watch mode, is that possible?

🔦 Context

I’m using parcel for CodingGame challenges, and as it has size limitation on submitted code files, have all optimizations enabled when I code in watch mode would be very useful.

1 possible answer(s) on “How to force parcel watch to use the same config as parcel build (minification, tree-shaking)?

  1. Thanks, that’s perfect with the API! 👍

    I’ll go with that, but still a --production flag could be useful on watch/serve commands to have the same code (despite the longer build time), as some issues sometimes arise only with minification, and in some cases it’s interesting to be able to quickly make changes to the production build (for debugging, testing…) 😉