runtime.ts 812 B

123456789101112131415161718192021222324252627
  1. // This entry exports the runtime only, and is built as
  2. // `dist/vue.esm-bundler.js` which is used by default for bundlers.
  3. import { NOOP } from '@vue/shared'
  4. import { initDev } from './dev'
  5. import { type RenderFunction, warn } from '@vue/runtime-dom'
  6. if (__DEV__) {
  7. initDev()
  8. }
  9. export * from '@vue/runtime-dom'
  10. export const compile = (_template: string): RenderFunction => {
  11. if (__DEV__) {
  12. warn(
  13. `Runtime compilation is not supported in this build of Vue.` +
  14. (__ESM_BUNDLER__
  15. ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
  16. : __ESM_BROWSER__
  17. ? ` Use "vue.esm-browser.js" instead.`
  18. : __GLOBAL__
  19. ? ` Use "vue.global.js" instead.`
  20. : ``) /* should not happen */,
  21. )
  22. }
  23. return NOOP
  24. }