Rendered HTML assumes app lives in domain root
See original GitHub issueDo you want to request a feature or report a bug? feature
What is the current behaviour?
The rendered index.html has references to the generated JS and CSS files prefixed with /
, meaning you can’t run the app from a directory, say.
If the current behaviour is a bug, please provide the steps to reproduce.
$ preact create typescript my-project
$ npm run build
What is the expected behaviour?
The generated src
tags are relative to the index.html
If this is a feature request, what is motivation or use case for changing the behaviour? I want to run my Preact app in a subfolder.
Please mention other relevant information.
I can find there is an EJS template at src/template.html
, but it is completely opaque how preact.headEnd
would be filled. I would like
Please paste the results of preact info
here.
Environment Info:
System:
OS: Linux 5.4 Ubuntu 20.10 (Groovy Gorilla)
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
npm: 6.14.6 - ~/.nvm/versions/node/v12.16.1/bin/npm
Browsers:
Firefox: 84.0
npmPackages:
preact: ^10.3.1 => 10.5.7
preact-cli: ^3.0.0 => 3.0.5
preact-render-to-string: ^5.1.4 => 5.1.12
preact-router: ^3.2.1 => 3.2.1
npmGlobalPackages:
preact-cli: 3.0.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (10 by maintainers)
Top GitHub Comments
@digitalheir Now I think I understand, I believe Jason was saying WMR is framework/library agnostic, not build tool agnostic. You don’t have to use Preact with it. People got it working with Angular rather quickly and I think others were trying Svelte and Vue. That makes the most sense to me, though I’ll still have a listen.
I was working with an old cache, I think. I redeployed and it works now. Thank you!