-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Support optional public base path configuration #8540
Comments
Maybe the Also you can check out a related the proposal at |
The |
One of the place is |
First the reference should be placed in |
I see. How about doing it like this? (stackblitz) import { defineConfig } from 'vite';
export default defineConfig({
base: '/foo/',
plugins: [
{
name: 'inject',
transformIndexHtml() {
return [
{
tag: 'script',
attrs: { type: 'module', src: '/external.js', defer: true },
},
];
},
},
],
}); |
Closing due to lack of response. |
Clear and concise description of the problem
Based on the document,
Vite handles all asset references automatically which means inject
base
path for all resources in.html
files. I'm facing one situation which is that, inindex.html
some resource references are provided by other microservices but in same origin, these resource should not respect the base public path config. I didn't find a solution to solve this problem.Suggested solution
Maybe
base
can provide a exclusion config or there is a flag we can use to mark these resources to not respect the base public path config.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: