You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+9-11Lines changed: 9 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -73,10 +73,16 @@ The default test script will do the following: lint with ESLint -> type check wi
73
73
74
74
## Project Structure
75
75
76
-
-**`build`**: contains build-related configuration files. In most cases you don't need to touch them.
76
+
-**`build`**: contains build-related configuration files. In most cases you don't need to touch them. However, it would be helpful to familiarize yourself with the following files:
77
+
78
+
-`build/alias.js`: module import aliases used across all source code and tests.
79
+
80
+
-`build/config.js`: contains the build configurations for all files found in `dist/`. Check this file if you want to find out the entry source file for a dist file.
77
81
78
82
-**`dist`**: contains built files for distribution. Note this directory is only updated when a release happens; they do not reflect the latest changes in development branches.
79
83
84
+
See [dist/README.md](https://github.com/vuejs/vue/blob/dev/dist/README.md) for more details on dist files.
85
+
80
86
-**`flow`**: contains type declarations for [Flow](https://flowtype.org/). These declarations are loaded **globally** and you will see them used in type annotations in normal source code.
81
87
82
88
-**`packages`**: contains `vue-server-renderer` and `vue-template-compiler`, which are distributed as separate NPM packages. They are automatically generated from the source code and always have the same version with the main `vue` package.
@@ -85,16 +91,6 @@ The default test script will do the following: lint with ESLint -> type check wi
85
91
86
92
-**`src`**: contains the source code, obviously. The codebase is written in ES2015 with [Flow](https://flowtype.org/) type annotations.
87
93
88
-
-**`entries`**: contains entries for different builds and packages.
89
-
90
-
-**`web-runtime`**: the entry for `dist/vue.common.js`, a.k.a the runtime-only build. It does not include the template to render function compiler, so it does not support the `template` option. **This is set as the `main` field in `package.json` so it is the default export when you import Vue as an NPM package.**
91
-
92
-
-**`web-runtime-with-compiler`**: the entry for `dist/vue.js`, a.k.a the standalone build. It includes the template to render function compiler. To use this build from the NPM packages, do `import Vue from 'vue/dist/vue'`, or alias `vue` to `vue/dist/vue` in your build tool configuration.
93
-
94
-
-**`web-compiler.js`**: the entry for the `vue-template-compiler` NPM package.
95
-
96
-
-**`web-server-renderer.js`**: the entry for the `vue-server-renderer` NPM package.
97
-
98
94
-**`compiler`**: contains code for the template-to-render-function compiler.
99
95
100
96
The compiler consists of a parser (converts template strings to element ASTs), an optimizer (detects static trees for vdom render optimization), and a code generator (generate render function code from element ASTs). Note the codegen directly generates code strings from the element AST - it's done this way for smaller code size because the compiler is shipped to the browser in the standalone build.
@@ -117,6 +113,8 @@ The default test script will do the following: lint with ESLint -> type check wi
Entry files for dist builds are located in their respective platform directory.
117
+
120
118
Each platform module contains three parts: `compiler`, `runtime` and `server`, corresponding to the three directories above. Each part contains platform-specific modules/utilities which are then imported and injected to the core counterparts in platform-specific entry files. For example, the code implementing the logic behind `v-bind:class` is in `platforms/web/runtime/modules/class.js` - which is imported in `entries/web-runtime.js` and used to create the browser-specific vdom patching function.
121
119
122
120
-**`sfc`**: contains single-file component (`*.vue` files) parsing logic. This is used in the `vue-template-compiler` package.
0 commit comments