File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -214,3 +214,18 @@ An example of cross drive links are:
214214- a symlink/junction to a different drive by ` mklink ` command (e.g. Yarn global cache)
215215
216216Related issue: [ #10802 ] ( https://github.com/vitejs/vite/issues/10802 )
217+
218+ <script setup lang =" ts " >
219+ // redirect old links with hash to old version docs
220+ if (typeof window !== " undefined" ) {
221+ const hashForOldVersion = {
222+ ' vite-cjs-node-api-deprecated' : 6
223+ }
224+
225+ const version = hashForOldVersion[location .hash .slice (1 )]
226+ if (version) {
227+ // update the scheme and the port as well so that it works in local preview (it is http and 4173 locally)
228+ location .href = ` https://v${ version} .vite.dev` + location .pathname + location .search + location .hash
229+ }
230+ }
231+ </script >
You can’t perform that action at this time.
0 commit comments