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

Fix: use relative base path to support static resources in public folder #86

Merged
merged 2 commits into from
Jan 14, 2024

Conversation

atomiechen
Copy link
Contributor

@atomiechen atomiechen commented Jan 10, 2024

Fix #69 . Assets in public folder are copied to ${build.outDir} by vite and not inlined by this plugin.

We CAN work with them, however, using relative path and place all resources in the same folder.

Changes of recommended build config:

  1. Set config.base to './' to enable relative path.
  2. Set config.build.assetsDir to '' to make generated files in ${build.outDir}'s root, instead of default ${build.outDir}/assets. Then the embedded resources can be loaded by relative path.

I also updated README to inform this in Caveats.

Static files in public folder are copied by Vite to output dir. We need output single html to correctly load them.
@atomiechen atomiechen mentioned this pull request Jan 10, 2024
@richardtallent richardtallent merged commit 11a7271 into richardtallent:main Jan 14, 2024
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.

Assets not included
2 participants