3 ms·
One of our (the front-end development company I work for) main principles of file management is to not use so called ‘sock drawers’, ie. folders with files all
by phortuin 10y ago
One of our (the front-end development company I work for) main principles of file management is to not use so called ‘sock drawers’, ie. folders with files all of the same kind (`/css` containing css, `/scripts` containing JS etc). Instead, we build up everything as components and put all belonging files in there. Example:
modules/
└── header/
├── header.html
├── header.demo.html
├── header.less
├── header.js
└── README.md
We don’t always use JS frameworks, because we are pretty adamant about progressive enhancement and JS frameworks have little love for PE. If we do use a framework, we still keep to the same file/folder structure (similar to your example; organising all component files in their own folder).
Bottom line is: for me, JS frameworks and code/file organisation have nothing to do with each other. Even if you build a no-JS website, you would still build components, views, have build tasks, a server app etc. The only thing missing is a couple of client side JS files here and there— and that won’t be of influence to the organisation of a project’s files.