Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pug as entry file #842

Closed
guillenotfound opened this issue Sep 21, 2020 · 3 comments
Closed

Support pug as entry file #842

guillenotfound opened this issue Sep 21, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@guillenotfound
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Imagine that you have several UIs depending on an environment variable, it's possible in JS land, but how would you do it in plain HTML?

VITE_UI=example1 npm run dev
VITE_UI=example2 npm run dev

Describe the solution you'd like
Support pug or any other templating language as entrypoint to allow sharing an index.pug and changing stuff like title, fonts, analytics,...

Describe alternatives you've considered
Mustache or jinja, but pug is already supported, which makes it very convenient.

@antfu
Copy link
Member

antfu commented Sep 21, 2020

With #793 & custom index.html path, you could probably make a plugin for that 😉

@underfin underfin added the enhancement New feature or request label Sep 27, 2020
@yyx990803
Copy link
Member

yyx990803 commented Jan 8, 2021

This is out of scope for Vite.

Actually, in 2.0 you can use a plugin + transformIndexHtml hook to do this.

@marlonmarcello
Copy link

Unfortunately I don't think #793 solves this issue.
Even by making a plugin using transformIndexHtml you would still need an index.html.

You can't have a structure like this for example:

_main.pug
index.pug << extends _main.pug
about/
  |-- index.pug << extends _main.pug
vite.config.js

I've been trying to develop a Pug plugin and I got stuck.
I also made a demo repo if that helps.
Any help is much appreciated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants