ktsn / vue-template-loader

Vue.js 2.0 template loader for webpack
MIT License
266 stars 26 forks source link

error loading html template #54

Closed agdolla closed 5 years ago

agdolla commented 5 years ago

Hi We have an existing vue project which I'm trying to move to vue cli3 (3.1.3). The existing codebase uses external html files as templates and I'm trying to use this vue-template-loader but I receive the following error:

Module Error (from ./node_modules/vue-template-loader/lib/template-loader.js):
(Emitted value instead of an instance of Error) template syntax error Component template requires a root element, rather than just text.

my vue.config.js:

module.exports = {
  lintOnSave: false,
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        ws: true,
        changeOrigin: true
      }
    }
  },
  chainWebpack: config => {
    config.module
      .rule('html')
      .test(/\.html$/)
      .exclude.add(/index\.html/).end()
      .set('loader', 'vue-template-loader')
      .end();
  }
}

Please help.

Gabor

agdolla commented 5 years ago

sorry, my bad