Meteor 1.3+. Should I have client folder inside imports folder?

Hi,
This is my folder structure:

├── client
│   ├── head.html
│   └── main.js
├── imports
│   ├── components //place it inside imports/client/?
│   ├── pages //place it inside imports/client/?
│   └── startup
│       └── client
│           ├── index.js
│           ├── routes.js
│           └── startup.js
├── mobile-config.js
├── package.json
├── public

Should I create /client folder inside /imports and place/components & /pages there, for not to load files inside these dirs on the server, or anyway they will load only where I’ll import them?

i.e. will files inside imports/components or imports/pages load on a server if I don’t place them inside /client folder?

They will only load where you import them, but you can get faster rebuilds by separating client-only and server-only files in client/ and server/ folders respectively under imports/.

2 Likes

Thanks!

So is it a better structure?

├── client
│   ├── head.html
│   └── main.js
├── imports
│   └── client
│       ├── components
│       ├── pages
│       └── startup
│           ├── index.js
│           ├── routes.js
│           └── startup.js
├── mobile-config.js
├── package.json
├── public
1 Like

:thumbsup:

1 Like

I often use client/imports instead of imports/client. This allows me to have everything client related in the single directory.