If you’re like me, the bundle-visualizer
is one of the most awesome things you got for 1.5 christmas.
I’d like to write a npm script that adds the bundle-visualizer
temporarily, and runs the app in production on another port. Is there a way to do that without adding the package to my other running environment?
-
meteor add bundle-visualizer
temporarily, or for this run only
meteor run --production --port 5000
Will you provide us with examples on how you’re using it (or plan to), and how to use it properly?
The idea is to quickly be able to check the bundle size, without having to manually add and then remove the bundle-visualizer
package.
Building the app for production minifies the code, so the whole process takes about 3-5 minutes on my machine, during which the chart is visible in my dev environment.
I believe that https://github.com/meteor/meteor/issues/8739 will actually allow you to do exactly what you’re trying to do, but you should keep in mind that other --production
run will be crunching hard on minifying your changes and competing with your primary meteor
tool for resources.
Realistically though, do you really need to be constantly checking your bundle size? Seems like something you could consider once in a while, at the end of the day, or after you’ve consciously added a package (or chain of packages).
3 Likes