# vue
## Which dist file to use?
### From CDN or without a Bundler
- **`vue(.runtime).global(.prod).js`**:
- For direct use via `<script src="...">` in the browser. Exposes the `Vue` global.
- Note that 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="...">`.
- In-browser template compilation:
- **`vue.global.js`** is the "full" build that includes both the compiler and the runtime so it supports compiling templates on the fly.
- **`vue.runtime.global.js`** contains only the runtime and requires templates to be pre-compiled during a build step.
- Inlines all Vue core internal packages - i.e. it's a single file with no dependencies on other files. This means you **must** import everything from this file and this file only to ensure you are getting the same instance of code.
- Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `*.prod.js` files for production.
- **`vue(.runtime).esm-browser(.prod).js`**:
- For usage via native ES modules imports (in browser via `<script type="module">`.
- Shares the same runtime compilation, dependency inlining and hard-coded prod/dev behavior with the global build.
### With a Bundler
- **`vue(.runtime).esm-bundler.js`**:
- For use with bundlers like `webpack`, `rollup` and `parcel`.
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
- Does not ship minified builds (to be done together with the rest of the code after bundling)
- Imports dependencies (e.g. `@vue/runtime-core`, `@vue/runtime-compiler`)
- Imported dependencies are also `esm-bundler` builds and will in turn import their dependencies (e.g. `@vue/runtime-core` imports `@vue/reactivity`)
- This means you **can** install/import these deps individually without ending up with different instances of these dependencies, but you must make sure they all resolve to the same version.
- In-browser template compilation:
- **`vue.runtime.esm-bundler.js` (default)** is runtime only, and requires all templates to be pre-compiled. 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).
- **`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). You will need to configure your bundler to alias `vue` to this file.
### For Server-Side Rendering
- **`vue.cjs(.prod).js`**:
- For use in Node.js server-side rendering via `require()`.
- If you bundle your app with webpack with `target: 'node'` and properly externalize `vue`, this is the build that will be loaded.
- The dev/prod files are pre-built, but the appropriate file is automatically required based on `process.env.NODE_ENV`.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
vue-3.0.0-beta.3.zip (399个子文件)
style.css 1KB
.gitignore 70B
todomvc.html 5KB
todomvc.html 5KB
grid.html 3KB
grid.html 3KB
svg.html 3KB
svg.html 3KB
modal.html 3KB
tree.html 2KB
tree.html 2KB
list.html 2KB
commits.html 2KB
commits.html 2KB
markdown.html 1KB
markdown.html 1KB
local.html 915B
index.html 898B
rollup.config.js 7KB
release.js 6KB
build.js 5KB
bootstrap.js 3KB
jest.config.js 1KB
dev.js 1KB
utils.js 933B
verifyCommit.js 892B
jest.js 236B
index.js 195B
index.js 191B
index.js 189B
index.js 189B
index.js 189B
index.js 187B
index.js 185B
index.js 177B
index.js 171B
namedChars.json 44KB
package.json 2KB
package.json 1KB
package.json 1KB
package.json 957B
package.json 948B
package.json 891B
package.json 884B
package.json 821B
api-extractor.json 799B
package.json 767B
launch.json 740B
tsconfig.json 730B
package.json 719B
package.json 707B
package.json 670B
settings.json 475B
package.json 270B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 218B
api-extractor.json 211B
api-extractor.json 210B
api-extractor.json 210B
api-extractor.json 210B
package.json 162B
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
LICENSE 1KB
yarn.lock 287KB
CHANGELOG.md 55KB
contributing.md 14KB
README.md 3KB
commit-convention.md 3KB
README.md 3KB
README.md 1KB
README.md 790B
README.md 596B
issue-template.md 514B
README.md 478B
README.md 393B
README.md 317B
README.md 198B
README.md 186B
README.md 87B
README.md 21B
README.md 19B
README.md 19B
.prettierrc 45B
parse.spec.ts.snap 154KB
hoistStatic.spec.ts.snap 12KB
vSlot.spec.ts.snap 8KB
vModel.spec.ts.snap 7KB
vFor.spec.ts.snap 6KB
codegen.spec.ts.snap 4KB
共 399 条
- 1
- 2
- 3
- 4
资源评论
a3737337
- 粉丝: 0
- 资源: 2869
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功