Closed JessicaSachs closed 4 years ago
Nested static routes are no longer rendering or redirecting properly
/subdir/index.html
/index.html
If this is now the desired behavior, it is also failing to execute the redirect properly.
/subdir/main.js
/main.js
https://github.com/JessicaSachs/vite-component-test-starter/tree/repro/vite-0.15.3
npm i npm run dev open http://localhost:3000/test/index.html
vite
vite v0.15.3 vite:resolve (node_module entry) vue -> vue/dist/vue.runtime.esm-bundler.js +0ms [vite] Optimizable dependencies detected. Pre-bundling them to speed up dev server page load... (this will be run only when your dependencies have changed) Optimized modules: vue Dev server running at: > Local: http://localhost:3000/ > Network: http://172.16.10.52:3000/ vite:server server ready in 874ms. +0ms redirecting / to /index.html vite:hmr /index.html imports /main.js +0ms vite:rewrite /index.html: no imports found. +0ms not redirecting /main.js (has file extension) vite:rewrite /main.js: rewriting +167ms vite:rewrite "vue" --> "/@modules/vue" +0ms vite:hmr /main.js imports /@modules/vue +168ms vite:rewrite "./App.vue" --> "/App.vue" +1ms vite:hmr /main.js imports /App.vue +1ms vite:hmr ws client connected +445ms vite:resolve (optimized) vue -> node_modules/.vite_opt_cache/vue.js +0ms vite:sfc /Users/jess/projects/vite-component-test-starter/App.vue parsed in 5ms. +0ms vite:rewrite /App.vue: rewriting +454ms vite:rewrite "vite/hmr" --> "/vite/hmr" +0ms vite:rewrite /@modules/vue: no imports found. +5ms vite:sfc /Users/jess/projects/vite-component-test-starter/App.vue parse cache hit +7ms vite:sfc /App.vue template compiled in 15ms. +15ms vite:rewrite (skipped) /App.vue?type=template +16ms vite:sfc /Users/jess/projects/vite-component-test-starter/App.vue parse cache hit +5ms vite:sfc /App.vue style compiled in 59ms +59ms vite:rewrite (skipped) /App.vue?type=style&index=0 +65ms redirecting /test/index.html to /index.html vite:rewrite /index.html: serving from cache +5s not redirecting /test/main.js (has file extension) vite:rewrite (skipped) /test/main.js +20ms vite:hmr ws client connected +5s
Nice. Just verified this works in the latest (0.15.5) and upgraded Vite Component Test Starter to use it
Describe the bug
Nested static routes are no longer rendering or redirecting properly
/subdir/index.html
would render that page and then import the proper files./subdir/index.html
attempt to redirect to/index.html
If this is now the desired behavior, it is also failing to execute the redirect properly.
/subdir/index.html
, the page served is/index.html
/index.html
are executed relative to the originally requested file... e.g./subdir/main.js
is requested instead of/main.js
Reproduction
https://github.com/JessicaSachs/vite-component-test-starter/tree/repro/vite-0.15.3
System Info
vite
version: 0.15.3Logs (Optional if provided reproduction)