vue3-yuanma/packages/vue
2020-03-06 15:58:40 -05:00
..
__tests__ test: test updates for d40c642 2020-02-11 18:40:42 -05:00
examples feat(runtime-core): add watchEffect API 2020-02-22 08:19:10 +01:00
src build: avoid runtime wildcard import in global build 2020-02-13 18:50:36 -05:00
api-extractor.json build: use api-extractor for type rollup 2019-09-03 12:16:22 -04:00
index.js build: add vue package 2018-10-23 11:58:37 -04:00
package.json release: v3.0.0-alpha.8 2020-03-06 15:58:40 -05:00
README.md chore: further edit formats and include it in vue package readme [ci skip] 2019-12-23 10:28:40 -05:00

vue

Which dist file to use?

  • vue.global(.prod).js:

    • For direct use via <script src="..."> in the browser. Exposes the Vue global.
    • Note: global builds are not UMD builds. Instead they are built as IIFEs.
  • *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 depdencies 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).
  • 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 nad 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.cjs(.prod).js:

    • For use in Node.js server-side rendering via require().
    • 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').