Vuepress: How to get vuepress to load the compiler-included build of vue?

Created on 10 May 2018  路  3Comments  路  Source: vuejs/vuepress

Inspirational Error Message:
_You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build._

From:
docs/.vuepress/components/Hello.vue

<template>
            <component :is="{
                    template: '<div> hello </div>'
                }" />
</template>

This is one of many use cases where a vuepress doc might "need" the full compiler-included build.

FWIW. Using Nuxt, the following incantation can be added inside the build extend(config,ctx) function:

 config.resolve.alias['vue'] = 'vue/dist/vue.common.js'

So maybe I am asking, how does one get vue.common.js loaded within vuepress?

Most helpful comment

See: https://vuepress.vuejs.org/config/#chainwebpack

You can:

// .vuepress/config.js
chainWebpack(config) {
  config.resolve.alias.set('vue', 'vue/dist/vue.common.js')
}

All 3 comments

See: https://vuepress.vuejs.org/config/#chainwebpack

You can:

// .vuepress/config.js
chainWebpack(config) {
  config.resolve.alias.set('vue', 'vue/dist/vue.common.js')
}

After including the error message, your question is clearer. As @fjc0k mentioned could help, or set vue$ to aviod some unexpected alias parsing.

Brilliant, everyone. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AMontagu picture AMontagu  路  3Comments

lesliecdubs picture lesliecdubs  路  3Comments

harryhorton picture harryhorton  路  3Comments

zeke picture zeke  路  3Comments

tinchox5 picture tinchox5  路  3Comments