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


#1

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?


#2

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/.


#3

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

#4

:thumbsup:


#5

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