You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
I am creating a small package shipping some custom input fields for a project of ours. For templates I use pug. I decided to build it for production with rollup instead of webpack for a number of reasons. But it did not compile. For development (with webpack) I had no problem, the problem came from building with rollup.
After digging into the very depth of almost every related packege I found that it is the old problem with pug: that by default it compiles to XML, so valueless attributes (like a directive v-focus) will get their name for value (v-focus="v-focus"). Now the solution was simple: tell pug to compile to html instead.
But.
It took another half day of digging into source codes to find that it is possible simply by passing rollup-plugin-vue the option: template.preprocessOptions.pug.doctype = 'html'.
Mentioning it in the docs might save others the trouble. Also, I think it would be useful to have examples for some options, sometimes just mentioning them does not help that much.
What problem does this feature solve?
I am creating a small package shipping some custom input fields for a project of ours. For templates I use
pug
. I decided to build it for production withrollup
instead ofwebpack
for a number of reasons. But it did not compile. For development (withwebpack
) I had no problem, the problem came from building withrollup
.After digging into the very depth of almost every related packege I found that it is the old problem with
pug
: that by default it compiles toXML
, so valueless attributes (like a directivev-focus
) will get their name for value (v-focus="v-focus"
). Now the solution was simple: tellpug
to compile tohtml
instead.But.
It took another half day of digging into source codes to find that it is possible simply by passing
rollup-plugin-vue
the option:template.preprocessOptions.pug.doctype = 'html'
.Mentioning it in the docs might save others the trouble. Also, I think it would be useful to have examples for some options, sometimes just mentioning them does not help that much.
What does the proposed API look like?
Extend docs at Options/template:
template.preprocessOptions
{ [lang: string]: object }
undefined
{ pug: { doctype: 'html' } }
The text was updated successfully, but these errors were encountered: