feat(build): provide more specific warnings for runtime compilation

close #1004
This commit is contained in:
Evan You
2020-04-20 15:23:26 -04:00
parent 171cfa404f
commit e954ba21f0
6 changed files with 34 additions and 8 deletions

View File

@@ -1,6 +1,21 @@
// This entry exports the runtime only, and is built as
// `dist/vue.esm-bundler.js` which is used by default for bundlers.
import './devCheck'
import { warn } from '@vue/runtime-dom'
export * from '@vue/runtime-dom'
import './devCheck'
export const compile = () => {
if (__DEV__) {
warn(
`Runtime compilation is not supported in this build of Vue.` +
(__ESM_BUNDLER__
? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
: __ESM_BROWSER__
? ` Use "vue.esm-browser.js" instead.`
: __GLOBAL__
? ` Use "vue.global.js" instead.`
: ``) /* should not happen */
)
}
}