# 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
最新资源
- PMP备考常见传统敏捷术语表 PMP备考必备 PMP术语
- 大数据实验2和6数据和python源代码.7z
- 全面解析:JavaScript语言核心技术及应用领域教程
- Java-wms基于JAVA的智能仓储管理系统, 包含PDA端和WEB端, 功能涵盖WMS(仓库管理系统), OMS(订单管理系统), BMS(财务管理系统), TMS(运输管理系统)
- MATLAB环境下基于隐马尔可夫模型-高斯混合模型-期望最大化的图像分割算法 算法运行环境为MATLAB R2021b,使用期望最大化(EM)算法进行图像分割,并同时依赖于高斯混合模型(GMM)和马尔
- 00大数据期末复习资料.7z
- 欧姆龙PLC程序欧姆龙案例欧姆龙标准程序 本产品适用于新手或者需要学习欧姆龙脉冲控制的新手 本程序包括有欧姆龙CP1H脉冲程序案例,威纶通触摸屏程序,word讲义 程序涉及方面广,适合新手入门学习
- aLinux(大三嵌入式).7z
- WebSocket协议:高效实现现代Web应用的实时通信解决方案
- 软件工程实验提交要求.zip
- 基于Javamail的邮件收发系统(系统+论文+开题报告+任务书+外文翻译+文献综述+答辩PPT).zip
- Hive函数应用实例解析:提升数据分析效率
- 软件工程PDF、思维导图、用例图、类图.7z
- 0软件工程期中、期末考.7z
- 通过FTP上传文件到一个或者多个CDN资源
- 宠物的每一帧,请务必和代码放在同一路径下再运行
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈