2

I built a new electron-Vue application and installed the pug and pug-plain-loader packages. When I run the application, I am getting an error in the console:

"Errors compiling template: Component template requires a root element, rather than just text."

Is there any configuration I need to add or a specific package I need to download in order for this to work?

itsvinayak
  • 140
  • 1
  • 16
pixellini
  • 21
  • 2

1 Answers1

0

Add package pug, pug-plain-loader:

yarn add pug pug-plain-loader

Open file webpack.renderer.config.js append more option to rules:

{
  module: {
    rules: [
      {
        test: /\.pug$/,
        loader: 'pug-plain-loader'
      }
    ]
  }
} 
1Rhino
  • 298
  • 3
  • 12