Is there any way to remove Minimongo thing?

My meteor-vue project uses no subscription except the default account package.

Now I want to completely remove the minimongo + collection + simple schema which is about 150kb minified.
I also want to get rid of the hot reload, It’s bad because every time i update the app and user’s browser got refreshed suddenly which is redundant and bad UX. Also, when there’s many users , the server would be kinda crashed for updating all the files to the browsers.

I haven’t used it, but it should be possible to remove those packages to achieve what you are looking for.

I haven’t used it What do you mean ?
What front things are you using ?

Minimongo is basically what you get with the mongo package. Remove the mongo package and you removed the Minimongo, too. If you only want mongo on the server, remove mongo from .meteor/packages and create a local empty package with the following package.js:

Package.describe({
  name: 'mynamespace:mongo-server-only',
  version: '1.0.0',
  // Brief, one-line summary of the package.
  summary: '',
  // URL to the Git repository containing the source code for this package.
  git: '',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
})

Package.onUse(function (api) {
  api.versionsFrom('1.0')
  api.use('ecmascript', 'server')
  api.use('mongo', 'server')
})
1 Like

You can disable Hot Code Push with this one-liner:

Reload._onMigrate(() => [false]);

More info can be found here:


and here

1 Like

@waldgeist @jkuester Thank you a lot !
I’ll try it later.

But I wonder how the account things work, If i would able to remove the mini-mongo ?

1 Like

They would not work currently:

Why is size such an issue in this case? Can’t you separate for example your public / SEO pages from the rest of the Meteor app? To get around the issue?

1 Like

I see, Thank you for telling me.
Even though i have ssr in my app but still many functions only available on Client side,So the big file size impact the ux for mobile users.
And i don’t know if any good website exists when it got a big bundle js file. (Mine is ~330kb js + 35kb css gzipped )
I wanted to move the app to raw Vue app with Meteor http server. But never started because of the obstacles i will face, like:
How do i migrate the account package? (seems so hard , Maybe i’ll compromise it by tell all of my users “Our system had a big update, so your old account with password login will not working any more” )
How stable is Meteor Http compare to the native Ddp?

It depends on your strategy. If you really want the smallest bundle size sent to the client you should remove all dependencies generally. But it will take a lot of time on development to get back all the features. It’s always an act of balance.

Did you already analyze your bundle size? https://docs.meteor.com/packages/bundle-visualizer.html

Did you read about dynamic imports? https://blog.meteor.com/dynamic-imports-in-meteor-1-5-c6130419c3cd

If you get a clear strategy on what it’s worth to remove all standard tools you can make a good assessment on where to improve.

Edit: Also interesting: https://medium.com/fasal-engineering/meteor-app-size-optimization-a-journey-from-9-mb-to-4-5-mb-a388be8047c6

I did and been doing.
I use bundle analyzer and all my pages/routes are using dynamic import (the package itself already +30kb)

I can’t optimize it anymore when it comes to remove the core packages , Simple-schema,Minimongo,Vue,Collection2,Lodash, Also I have “moment-timezone” which got a prototype function and used every page, So i can’t remove it.
My own written code, after dynamic imports, got only single kb gzipped on first load. Everything goes to the packages and unable to get rid of