What is the meaning of the /dist directory in open source projects?
Answer a question
Since I first saw a dist/ directory in many open source projects, usually on GitHub, I've been wondering what it means.
With dist, vendor, lib, src, and many other folder names that we see quite often, I sometimes wonder how I should name my own folders.
Correct me if I'm wrong!
- src: Contains the sources. Sometimes only the pure sources, sometimes with the minified version, depends on the project.
- vendor: Contains other dependencies, like other open source projects.
- lib: Good question, it's really close to
vendoractually, depending on the project we can see one or another or both... - dist: From what I saw, it contains the "production" files, the one we should use if we want to use the library.
Why is open source so confusing? Isn't it possible to do things clearer? At least per language because some languages use specific names.
Answers
To answer your question:
/dist means "distributable", the compiled code/library.
Folder structure varies by build system and programming language. Here are some standard conventions:
-
src/: "source" files to build and develop the project. This is where the original source files are located, before being compiled into fewer files todist/,public/orbuild/. -
dist/: "distribution", the compiled code/library, also namedpublic/orbuild/. The files meant for production or public use are usually located here.There may be a slight difference between these three:
build/: is a compiled version of yoursrc/but not a production-ready.dist/: is a production-ready compiled version of your code.public/: usually used as the files runs on the browser. which it may be the server-side JS and also include some HTML and CSS.
-
assets/: static content like images, video, audio, fonts etc. -
lib/: external dependencies (when included directly). -
test/: the project's tests scripts, mocks, etc. -
node_modules/: includes libraries and dependencies for JS packages, used by Npm. -
vendor/: includes libraries and dependencies for PHP packages, used by Composer. -
bin/: files that get added to your PATH when installed.
Markdown/Text Files:
README.md: A help file which addresses setup, tutorials, and documents the project.README.txtis also used.LICENSE.md: any rights given to you regarding the project.LICENSEorLICENSE.txtare variations of the license file name, having the same contents.CONTRIBUTING.md: how to help out with the project. Sometimes this is addressed in theREADME.mdfile.
Specific (these could go on forever):
package.json: defines libraries and dependencies for JS packages, used by Npm.package-lock.json: specific version lock for dependencies installed frompackage.json, used by Npm.composer.json: defines libraries and dependencies for PHP packages, used by Composer.composer.lock: specific version lock for dependencies installed fromcomposer.json, used by Composer.gulpfile.js: used to define functions and tasks to be run with Gulp..travis.yml: config file for the Travis CI environment..gitignore: Specification of the files meant to be ignored by Git.
更多推荐


所有评论(0)