question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rendered HTML assumes app lives in domain root

See original GitHub issue

Do 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:closed
  • Created 3 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
rschristiancommented, Dec 29, 2020

@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.

2reactions
digitalheircommented, Dec 29, 2020

I was working with an old cache, I think. I redeployed and it works now. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find the Document Root of your Website - InMotion Hosting
A domain's document root, also known as the home folder, ... Let's assume that the homepage for your website is named Welcome.html.
Read more >
Having links relative to root? - html - Stack Overflow
A root-relative URL starts with a / character, to look something like <a href="/directoryInRoot/fileName.html">link text</a> .
Read more >
Rendering pages server-side with Express (and Pug) · GitHub
Assuming you'll be using Pug, this is simply a matter of installing Pug... npm install --save pug ... and then configuring Express to...
Read more >
How to Develop and Deploy Your First Full-Stack Web App ...
First, move all your website's static files (HTML, CSS, JS, images, etc.) into a folder called public and create a file called server.js...
Read more >
Deploy server-side rendered apps with Amplify Hosting
Describes AWS Amplify deployment and hosting support for apps with server-side rendering (SSR).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found