New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Npm packages in the production bundle #9612
Comments
We have recently witnessed similar results with the materialize:materialize and grounddb packages. Somehow node_modules folders (mostly consisting of phantomjs) get added to the bundle. Our solution was to either upgrade the packages to their Npm counterparts or fork them and make some modifications to the package.json files included in the subdirectories (which were, apparently, not needed). |
Regarding Regarding |
Can you define what it means for a package to be "referenced" on the client? E.g. I require a package inside methods, wrapped with a |
Same problem here. I've decided to remove some stuff from the final build, to reduce my Docker image with 125MB! RUN find /app -type d \( \
-name "*-garbage-*" -o \
-name ".temp-*" -o \
-name "docs" -o \
-name "examples" -o \
-name "samples" -o \
-name "phantomjs-prebuilt" \
\) -exec rm -rf {} + The In addition to the folders above, I also remove some additional files: RUN find /app -type f \( \
-name "*.md" -o \
-name "*.markdown" -o \
-name "*.ts" -o \
-name "*.exe" \
\) -delete And a final step is to remove I expected that it would also be safe to remove At this moment, I've slimmed down my container from 521MB to 339MB by removing a couple of packages that were defined in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
At least, we can apply @smeijer script automatically after finishing build. Any idea how to integrate it? |
I have some problems with npm packages in my bundles.
client/
folder for example). Then I runmeteor build
. Wait (soooo many time). Open final archive and see/bundle/programs/server/npm/node_modules/
. Among other things I seelodash
folder. In the server area (!). What for?meteor build
. Wait. Open final archive and see/bundle/programs/server/npm/node_modules/meteor/reywood_publish-composite/node_modules/
. I seeeslint
folders. What for? Ok. Go to publish-composite github repository. Open thepackage.json
. All eslint packages indevDependencies
area. Why they in the production bundle?All of this points make my bundles sooo big. And it's very bad, I think.
Examples at my github repo: https://github.com/JWo1F/meteor-npm-bugs
Meteor version: 1.6.1.
Operating System: Fedora 21.
The text was updated successfully, but these errors were encountered: