aircolor memolog

Web制作・テクノロジー、たまに旅行記

Vueランタイム専用ビルドが必要なプラグインのエラーについて

vue2-circle-progress - npmというプラグインをインストールしようとした時に、

[Vue warn]: You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.

というエラーが出て困ったのでメモ。 Vue CLI3を使ってプロジェクトを作成しており、CLI 2系まで触れられたwebpackのconfigファイルが表から消えたので、どうするかちょい悩み。 少し探してみたら、vue.config.jsに以下のように書くことで回避できる模様。

// vue.config.js
module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        'vue$': 'vue/dist/vue.esm.js'
      }
    }
  }

serveコマンドを試してみたら、無事解決できた。

参考

github.com