-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
vite losts <script> in html when I set the root and outDir #16371
Labels
duplicate
This issue or pull request already exists
Comments
Duplicate of #15992 |
sapphi-red
added
duplicate
This issue or pull request already exists
and removed
pending triage
labels
Apr 7, 2024
this occurs when using path.resolve in all path too. |
It didn't happen with import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig({
root: resolve(import.meta.dirname,"src"),
build: {
outDir: "../dist",
rollupOptions: {
input: {
index: resolve(import.meta.dirname,"src/index.html"),
}
}
}
}) or import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig({
root: resolve(import.meta.dirname,"src"),
build: {
outDir: "../dist",
rollupOptions: {
input: {
index: resolve("src/index.html"),
}
}
}
}) for me. Would you describe what config you tried? |
Thank you for trying. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I am doing to bundle html file with js(ts) files.
What I expect is the js files added to html as script tag as I wrote.
What actually happening is the script tag that importing js files is removed from bundled html.
This is not occuring in
pnpm vite dev
the occuring version seems starting from 5.1.0.
this bug don't occur in "5.0.13" and occur in "5.1.0".
Reproduction
https://github.com/nyanrus/vite-minimal
Steps to reproduce
pnpm install
pnpm vite build
System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: