Are all files loaded to client from the parent dir?

This might be a beginner’s questions - but I couldn’t find an answer in the guide.

Let’s say I have a settings-dev.json and a settings-prod.json files in my parent dir. I’m using the “–settings settings-dev.json” flag, but since the settings-prod.json file is also present in the dir - is it loaded somehow to the clients?

How about the mobile-config.js (which I have to have in the parent dir, right?)?

Or how about “unrelated” .sh files I keep there for convenience?


If the settings object contains a key named public, then Meteor.settings.public will be available on the client as well as the server. All other properties of Meteor.settings are only defined on the server.

It’s in the docs:

If your Meteor application targets mobile platforms such as iOS or Android, you can configure your app’s metadata and build process in a special top-level file called mobile-config.js which is not included in your application and is used only for this configuration.

The build tool looks at file extensions for bundling: js, jsx, css etc. I don’t believe there’s a build plugin for .sh so they should be ignored

Thanks for the quick reply!

I understood that I won’t have access to the (non-public) settings on the client via Meteor.settings. But my question is different - is the file itself somehow uploaded… Unlike the mobile-config.js file, which the docs do specify (thanks for the pointer) that’s it’s not included in the app, what prevents those .json files from being included?

Also, what about config.push.json? This file also has to be in the parent directory (AFAIU), yet it contains some sensitive information.

These json files are never bundled, only parsed and loaded as js objects. From there the build tool can add the config to the relevant environment.

Having the .json extension on these means they’re not subject to client/server rules where you might want shared configs but .js files would still be bundled to both environments even if you used Meteor.isClient/isServer checks

config.push.json parse code:

1 Like