Best Practice to Organize Javascript Library & CSS Folder Structure

JavascriptJqueryHtmlCssJquery Ui

Javascript Problem Overview


How do you organize your js & css folder in your web application?

My current project structure is like this one:

root/
├── assets/
│   ├── js/
│   │   └──lib/
│   ├── css/
│   └── img/
└── index.html

But it's more complicated when I use many javascript library & css plugin. Javascript plugin comes with its own .js file and sometimes with its own .css file.

For example, when I use JQuery with JQueryUI plugin, I put the jquery.js and jquery-ui.js inside js/lib directory. But JQueryUI comes with its own css file. Where should I put the css from javascript plugin for best practice? Should I put them inside lib folder, to distinguish my css and javascript css plugin? Or somewhere else?

I know it's a personal preferences, but I just wanna know how you guys organize your project folder.

Thanks in advance :)

Javascript Solutions


Solution 1 - Javascript

 root/
   assets/
      lib/-------------------------libraries--------------------
          bootstrap/--------------Libraries can have js/css/images------------
              css/
              js/
              images/  
          jquery/
              js/
          font-awesome/
              css/
              images/
     common/--------------------common section will have application level resources             
          css/
          js/
          img/
     
 index.html

This is how I organized my application's static resources.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWilly LazuardiView Question on Stackoverflow
Solution 1 - JavascriptAkhleshView Answer on Stackoverflow