Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

[Docs request] options.template.preprocessOptions #319

Open
SzNagyMisu opened this issue Jan 10, 2020 · 0 comments
Open

[Docs request] options.template.preprocessOptions #319

SzNagyMisu opened this issue Jan 10, 2020 · 0 comments
Milestone

Comments

@SzNagyMisu
Copy link

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 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 does the proposed API look like?

Extend docs at Options/template:

template.preprocessOptions

  • type: { [lang: string]: object }
  • default: undefined
  • example: { pug: { doctype: 'html' } }
@znck znck added this to the Zero Issues milestone Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants