# 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`.
a3737337
- 粉丝: 0
- 资源: 2869
最新资源
- 电路分析基础 实验五 RLC串联谐振的multisim仿真
- 2个月涨粉8w,新玩法AI做漫画小说赛道,操作简单可批量制作,新手小白....mp4
- 高分辨率下的遥感目标分割
- 网络攻防原理与技术-实验8资料.7z
- 电机控制器,永磁同步电机调速控制软件工程PMSM,该工程主要基于DSP28335硬件控制平台,两电平IPM模块主回路,通过位置传感器,速度传感器实时检测位置和速度信号,电流传感器采集电流信号,控制器控
- 24年快手无人直播暴利变现3.0,直播间人气轻松破千上热门,普通人也能....mp4
- 2024年9月28日支付宝分成最新搬运玩法.mp4
- 西门子1200PLC模板通讯程序 modbus 包含多种通讯Modbus-RTU(485),S7通讯,Modbus-TCP,TCP IP等,博途V16及较新版本可打开,简单明了,初学者也能明白
- ICED Smart 网站部署教程文件
- 2024淘宝暴力掘金 单机500+.mp4
- 2024年最新暴力起店玩法,拼多多虚拟电商4.0,24小时实现成交,单人可以...mp4
- 2024影视解说最新玩法,AI一键生成原创影视解说, 十秒钟制作成品,解....mp4
- 2024掌握拼多多运营精髓:爆款流程、定价技巧与SKU设计实战课.mp4
- 房屋租赁推荐系统 房租租赁系统 基于协同过滤的房屋租赁推荐系统 特色功能:协同过滤推荐 对于房租租赁,结合实际场景选择用户对房子的浏览次数作为数据集,体现用户喜好度,应用余弦相似度,实现基于用户协同过
- X6程序模块 AE-10D00.GDL
- AspSweb网页服务器1.0.0.93
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈