use this
<script src="https://unpkg.com/vue@next/dist/vue.global.prod.js"></script>
or
<script src="https://unpkg.com/vue@next/dist/vue.global.js"></script>
The Vue package makes multiple packages available:
- vue.cjs.js
- vue.cjs.prod.js
- vue.esm-browser.js
- vue.esm-browser.prod.js
- vue.esm-bundler.js
- vue.global.js
- vue.global.prod.js
- vue.runtime.esm-browser.js
- vue.runtime.esm-browser.prod.js
- vue.runtime.esm-bundler.js
- vue.runtime.global.js
- vue.runtime.global.prod.js
You'd pick whichever one work best, but the simplest way to go is to use the vue.global.js during development and vue.global.prod.js in prod
Example
const app = Vue.createApp({
template: document.getElementById("appTemplate").innerHTML
})
app.component('my-component', {
template: document.getElementById("componentTemplate").innerHTML,
props:{name:{default: "🤷♂️"}}
})
app.mount('#app')
<script src="https://unpkg.com/vue@next/dist/vue.global.prod.js"></script>
<div id="app"></div>
<template id="appTemplate">
<h1>APP</h1>
<my-component name="world"></my-component>
</template>
<template id="componentTemplate">
Hello {{name}}
</template>