Skip to content

relative path approach#295

Merged
bourgeoa merged 1 commit intomainfrom
287relativePath
Feb 7, 2026
Merged

relative path approach#295
bourgeoa merged 1 commit intomainfrom
287relativePath

Conversation

@bourgeoa
Copy link
Contributor

@bourgeoa bourgeoa commented Feb 6, 2026

The issue is that you need different publicPaths for different deployments. The solution is to use relative paths in the HTML and set publicPath: '':

Now with publicPath:'' and relative paths (./mashlib.js), the chunks will load relative to wherever the HTML file is:

http://alice.localhost:3000/browse.html → loads ./mashlib.js and ./841.mashlib.js
https://solidos.github.io/mashlib/dist/browse.html → loads ./mashlib.js and ./841.mashlib.js
Rebuild with npm run build and both scenarios should work!

With publicPath: '', HtmlWebpackPlugin will inject <script src="mashlib.min.js"></script> (relative path without the ./ prefix, which is equivalent).

The generated databrowser.html will have relative paths for all assets, just like browse.html now does. Both work the same way.With publicPath: '', HtmlWebpackPlugin will inject <script src="mashlib.min.js"></script> (relative path without the ./ prefix, which is equivalent).

The generated databrowser.html will have relative paths for all assets, just like browse.html now does. Both work the same way.

Claude Son

@bourgeoa bourgeoa merged commit 846c3f0 into main Feb 7, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

1 participant