Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of vendor folder in web design

I am starting to build a website from scratch using python, django, and bootstrap. I have noticed that many times js, css, img. and fonts are stored in a folder vendor, such as:

/static/js/vendor/bootstrap/bootstrap.min.js
/static/css/vendor/bootstrap/bootstrap.min.css

or something similar.

What is the benefit of this folder structure over something like:

/static/bootstrap/js/bootstrap.min.js
/static/bootstrap/css/bootstrap.min.css

In the first example, when using the vendor folder as I have often seen, I would have to download bootstrap and unpack the downloaded folder into the js and css vendor sub-directories. In the second example, I can download bootstrap and drop the downloaded folder into /static without having to unpack anything.

like image 492
Dan Avatar asked Apr 26 '18 22:04

Dan


People also ask

What is the use of vendor folder?

If you are coming from Node. js land, Golang's vendor folder is basically the same as Node's node_modules . It is a folder found at the root of a module that stores a copy of all the code the module depends on. The code is used to compile the final executable when the go build command is run.

What is vendor in Web?

/vendor usually refers to a directory that contains third party plugins.

What is vendor folder in Rails?

Vendor is a directory to hold third party files, code, etc that you didn't write yourself. Check out this link for more information about vendors. http://programmers.stackexchange.com/questions/123305/what-is-the-difference-between-the-lib-and-vendor-folders. Hope this helps.

What is vendor folder in Drupal?

"vendor" is the folder where a Drupal - composer Installation stores it's libraries.

Where is the vendor folder?

The vendor is a subfolder in the Laravel root directory. It includes the Composer dependencies in the file autoload. php.

What does vendor mean in programming?

A software vendor is a company that develops and sells software. Most commonly, the term software vendors refers specifically to independent software vendors (ISVs), organizations that create solutions for use by the larger market.


1 Answers

The vendor folder is where you usually (I'm using the word 'usually' because it's not exactly a rule but more of a preference in the coding community with the purpose of having a semantic directory structure) keep third-party resources(icons, images, codes, you name it) as opposed to a lib (library) folder where you or the author of the site/application to be specific keep your original codes in.

So if I were to download and use the site/application in the hypothetical scenario above, I can then create relevant folders for each data type (src/images for images, style/css for css, script/js for js, etc) and move required assets from the lib folder to the new folders without having to edit the third-party codes (or other assets) thus making it easier to rollback on any changes made that cause errors and such.

like image 84
AndrewL64 Avatar answered Sep 24 '22 16:09

AndrewL64