Using imports folder in Meteor 1.3 - no need for client/server/lib folders?

If I put my entire app’s code in /imports, does this mean I don’t have to use the typical folder structure of client, server, etc, since I can control exactly when things are loaded and where?

you don’t necessarily need it

You still need these folders if to bootstrap the loading of the import files.

Right, that makes sense. So in /server there could be a file that does something like:

import '../imports/startup/server';

And that folder structure looks like:

β”œβ”€β”€ startup
β”‚   β”œβ”€β”€ client
β”‚   β”‚   └── routes.js
β”‚   └── server
β”‚       β”œβ”€β”€ fixtures.js
β”‚       β”œβ”€β”€ index.js
β”‚       β”œβ”€β”€ publications.js
β”‚       β”œβ”€β”€ security.js
β”‚       β”œβ”€β”€ slingshot-directives.js
β”‚       └── triggers.js

Yep, that’s how I’ve been doing it! :slight_smile:

1 Like