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

Dev server fails to start when EJS is used in index.html #9

Closed
Esardes opened this issue Apr 16, 2021 · 3 comments
Closed

Dev server fails to start when EJS is used in index.html #9

Esardes opened this issue Apr 16, 2021 · 3 comments

Comments

@Esardes
Copy link

Esardes commented Apr 16, 2021

I have the same issue described there by @yurique
He already created an example repo to reproduce

git clone [email protected]:yurique/vite-html-plugin-bug.git
cd vite-html-plugin-bug
yarn
yarn dev
@anncwb
Copy link
Collaborator

anncwb commented Apr 16, 2021

I think it should not be possible to write like this. Before Vite starts, it will scan the src of the script tag, then optimize the esm, and then perform the html conversion (the plug-in starts to work at this step), so you can’t meet this writing

@yurique
Copy link

yurique commented Apr 17, 2021

Is there a better way to specify the js depending on whether it's a dev build or prod build?

@Esardes
Copy link
Author

Esardes commented Apr 19, 2021

closing this ticket since it's not an issue with the plugin

@yurique I ended up doing something like this (in your setup it would mean hardcoding or templating the path to target/scalaversion/.../optOrFastopt in two separate html files)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants