vue3-core/packages/vue-compat/src/runtime.ts

24 lines
712 B
TypeScript
Raw Normal View History

2021-04-03 23:55:44 +08:00
// This entry exports the runtime only, and is built as
// `dist/vue.esm-bundler.js` which is used by default for bundlers.
2021-04-27 00:21:36 +08:00
import { createCompatVue } from './createCompatVue'
import { warn } from '@vue/runtime-core'
2021-04-03 23:55:44 +08:00
2021-04-27 00:21:36 +08:00
const Vue = createCompatVue()
2021-04-07 23:22:56 +08:00
Vue.compile = (() => {
2021-04-03 23:55:44 +08:00
if (__DEV__) {
warn(
`Runtime compilation is not supported in this build of Vue.` +
(__ESM_BUNDLER__
? ` Configure your bundler to alias "vue" to "@vue/compat/dist/vue.esm-bundler.js".`
: __ESM_BROWSER__
2021-07-20 06:24:18 +08:00
? ` Use "vue.esm-browser.js" instead.`
: __GLOBAL__
? ` Use "vue.global.js" instead.`
: ``) /* should not happen */
2021-04-03 23:55:44 +08:00
)
}
2021-04-07 23:22:56 +08:00
}) as any
export default Vue