"module": "dist/compiler-dom.esm-bundler.js",
"types": "dist/compiler-dom.d.ts",
"unpkg": "dist/compiler-dom/global.js",
+ "jsdelivr": "dist/compiler-dom/global.js",
"files": [
"index.js",
"dist"
"name": "VueCompilerDOM",
"formats": [
"esm-bundler",
+ "esm-browser",
"cjs",
- "global",
- "esm"
+ "global"
]
},
"repository": {
"module": "dist/reactivity.esm-bundler.js",
"types": "dist/reactivity.d.ts",
"unpkg": "dist/reactivity.global.js",
+ "jsdelivr": "dist/reactivity.global.js",
"files": [
"index.js",
"dist"
"name": "VueReactivity",
"formats": [
"esm-bundler",
+ "esm-browser",
"cjs",
- "global",
- "esm"
+ "global"
]
},
"keywords": [
"name": "VueRuntimeDOM",
"formats": [
"esm-bundler",
+ "esm-browser",
"cjs",
- "global",
- "esm"
+ "global"
],
"dts": [
"jsx.d.ts"
# @vue/runtime-test
+This is for Vue's own internal tests only - it ensures logic tested using this package is DOM-agnostic, and it runs faster than JSDOM.
+
+It can also be used as a reference for implementing a custom renderer.
+
``` js
import { h, render, nodeOps, dumpOps } from '@vue/runtime-test'
"type": "git",
"url": "git+https://github.com/vuejs/vue-next.git"
},
- "buildOptions": {
- "name": "VueRuntimeTest",
- "formats": [
- "global"
- ]
- },
"keywords": [
"vue"
],
- **`vue(.runtime).global(.prod).js`**:
- For direct use via `<script src="...">` in the browser. Exposes the `Vue` global.
- - 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>`.
- - **`vue.global.js`**: the "full" build that supports compiling templates on the fly.
- - **`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.
+ - 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.esm(.prod).js`**:
- - For usage via native ES modules imports (in browser via `<script type="module">`, or via Node.js native ES modules support in the future)
- - Inlines all dependencies - i.e. it's a single ES module with no imports from 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.
- - Hard-coded prod/dev branches, and the prod build is pre-minified (you will need to use different files for dev/prod)
+- **`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.
- - **`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).
- - **`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).
+ - 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
"module": "dist/vue.runtime.esm-bundler.js",
"types": "dist/vue.d.ts",
"unpkg": "dist/vue.global.js",
+ "jsdelivr": "dist/vue.global.js",
"sideEffects": false,
"files": [
"index.js",
"cjs",
"global",
"global-runtime",
- "esm"
+ "esm-browser",
+ "esm-browser-runtime"
]
},
"repository": {
file: resolve(`dist/${name}.esm-bundler.js`),
format: `es`
},
+ 'esm-browser': {
+ file: resolve(`dist/${name}.esm-browser.js`),
+ format: `es`
+ },
cjs: {
file: resolve(`dist/${name}.cjs.js`),
format: `cjs`
file: resolve(`dist/${name}.global.js`),
format: `iife`
},
- esm: {
- file: resolve(`dist/${name}.esm.js`),
- format: `es`
- },
- // main "vue" package only
+
+ // runtime-only builds, for main "vue" package only
'esm-bundler-runtime': {
file: resolve(`dist/${name}.runtime.esm-bundler.js`),
format: `es`
},
+ 'esm-browser-runtime': {
+ file: resolve(`dist/${name}.runtime.esm-browser.js`),
+ format: 'es'
+ },
'global-runtime': {
file: resolve(`dist/${name}.runtime.global.js`),
format: 'iife'
if (format === 'cjs' && packageOptions.prod !== false) {
packageConfigs.push(createProductionConfig(format))
}
- if (/global/.test(format) || format === 'esm') {
+ if (/^(global|esm-browser)(-runtime)?/.test(format)) {
packageConfigs.push(createMinifiedConfig(format))
}
})
const isProductionBuild =
process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file)
- const isGlobalBuild = /global/.test(format)
- const isRawESMBuild = format === 'esm'
- const isNodeBuild = format === 'cjs'
const isBundlerESMBuild = /esm-bundler/.test(format)
+ const isBrowserESMBuild = /esm-browser/.test(format)
+ const isNodeBuild = format === 'cjs'
+ const isGlobalBuild = /global/.test(format)
if (isGlobalBuild) {
output.name = packageOptions.name
const entryFile = /runtime$/.test(format) ? `src/runtime.ts` : `src/index.ts`
const external =
- isGlobalBuild || isRawESMBuild
+ isGlobalBuild || isBrowserESMBuild
? []
: [
...Object.keys(pkg.dependencies || {}),
isProductionBuild,
isBundlerESMBuild,
// isBrowserBuild?
- (isGlobalBuild || isRawESMBuild || isBundlerESMBuild) &&
+ (isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild) &&
!packageOptions.enableNonBrowserBranches,
isGlobalBuild,
isNodeBuild