Skip to content

Commit 9fc8ade

Browse files
committed
chore: update dist file readme
1 parent 4c1a193 commit 9fc8ade

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

packages/vue/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
22

33
## Which dist file to use?
44

5-
- **`vue.global(.prod).js`**:
5+
### From CDN or without a Bundler
6+
7+
- **`vue(.runtime).global(.prod).js`**:
68
- For direct use via `<script src="...">` in the browser. Exposes the `Vue` global.
7-
- Note: global builds are not [UMD](https://github.com/umdjs/umd) builds. Instead they are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
9+
- Note: global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src>`.
10+
- **`vue.global.js`**: the "full" build that supports compiling templates on the fly.
11+
- **`vue.runtime.global.js`**: runtime only, does not include runtime template compilation support. Use this if you are not using a bundler, but somehow pre-compiling your template.
12+
13+
- **`vue.esm(.prod).js`**:
14+
- For usage via native ES modules imports (in browser via `<script type="module">`, or via Node.js native ES modules support in the future)
15+
- Inlines all dependencies - i.e. it's a single ES module with no imports from other files
16+
- this means you **must** import everything from this file nad this file only to ensure you are getting the same instance of code.
17+
- Hard-coded prod/dev branches, and the prod build is pre-minified (you will need to use different files for dev/prod)
818

9-
- **`*vue(.runtime).esm-bundler.js`**:
19+
### With a Bundler
20+
21+
- **`vue(.runtime).esm-bundler.js`**:
1022
- For use with bundlers like `webpack`, `rollup` and `parcel`.
1123
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
1224
- Does not ship minified builds (to be done together with the rest of the code after bundling)
@@ -16,12 +28,9 @@
1628
- **`vue.runtime.esm-bundler.js`**: runtime only, does not include runtime template compilation support. **This is the default entry for bundlers (via `module` field in `package.json`)** because when using a bundler templates are typically pre-compiled (e.g. in `*.vue` files).
1729
- **`vue.esm-bundler.js`**: includes the runtime compiler. Use this if you are using a bundler but still want runtime template compilation (e.g. in-DOM templates or templates via inline JavaScript strings).
1830

19-
- **`vue.esm(.prod).js`**:
20-
- For usage via native ES modules imports (in browser via `<script type="module">`, or via Node.js native ES modules support in the future)
21-
- Inlines all dependencies - i.e. it's a single ES module with no imports from other files
22-
- this means you **must** import everything from this file nad this file only to ensure you are getting the same instance of code.
23-
- Hard-coded prod/dev branches, and the prod build is pre-minified (you will need to use different files for dev/prod)
31+
### For Server-Side Rendering
2432

2533
- **`vue.cjs(.prod).js`**:
2634
- For use in Node.js server-side rendering via `require()`.
27-
- The dev/prod files are pre-built, but are dynamically required based on `process.env.NODE_ENV` in `index.js`, which is the default entry when you do `require('vue')`.
35+
- If you bundle your app with webpack with `target: 'node'` and properly externalize `vue`, this is the build that will be loaded.
36+
- The dev/prod files are pre-built, but the appropriate file is automatically required based on `process.env.NODE_ENV`.

0 commit comments

Comments
 (0)