I am trying pug as template processor, I did it before in vuejs 2 projects. It is compatible?
I installed with yarn:
yarn add pug pug-loader
Edited App.vue:
<template lang="pug">
#app
router-view
</template>
<script>
export default {
name: 'veedar'
}
</script>
<style>
/* CSS */
</style>
and run:
yarn run dev
But I got this error:
Error compiling template:
#app
router-view
- Component template requires a root element, rather than just text.
i think you must add pug-plain-loader instead
Seems that it works!
I added pug-plain loader
I edited webpack.renderer.config.js and add the rule:
{
module: {
rules: [
{
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
}
}
Thanks a lot!
Most helpful comment
Seems that it works!
I added pug-plain loader
I edited
webpack.renderer.config.jsand add the rule:Thanks a lot!