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
change root path, entry html's source require will not found #4759
Comments
I can reproduce this with the react template and moving the |
Here's how I got it working the way I wanted it: export default defineConfig({
envDir: __dirname,
publicDir: Path.join(__dirname, "public"),
root: Path.join(__dirname, "src"),
build: {
outDir: Path.join(__dirname, "dist"),
rollupOptions: {
input: [Path.join(__dirname, "src/index.html")],
},
},
plugins: [
viteReact(),
],
resolve: {
alias: {
"@": Path.resolve(__dirname, "./src"),
},
},
}); |
Start a new pull request in StackBlitz Codeflow. |
I have looked at the related problems you mentioned in the past, but I have not found relevant solutions in them |
@waynebloss what's your folder structure |
And the vite config is on the root level with dist, public, src… |
#16629 should make this easier. The idea is you'd keep |
Describe the bug
After changing root path, in vite.config .
source which required in entry html , will not found.
Reproduction
https://stackblitz.com/edit/vitejs-vite-1dynea?file=ss%2Findex.html,vite.config.js&terminal=dev
System Info
System: OS: macOS 10.15.7 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 149.41 MB / 32.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.17.0 Yarn: 1.22.10 npm: 6.14.13 Browsers: Chrome: 92.0.4515.159 Safari: 14.1.2 npmPackages: vite: ^2.5.0 => 2.5.0
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: