router icon indicating copy to clipboard operation
router copied to clipboard

remove unnecessary sanitization to fix file based routing for windows

Open SaiKai opened this issue 2 years ago • 0 comments

fixes following problem for windows users:

following structure:

routes
├── posts
│   ├── index.tsx
│   └── $postId.tsx
├── posts.tsx
├── index.tsx
└── __root.tsx

should produce following output:

import { Route as rootRoute } from "./routes/__root"
import { Route as PostsImport } from "./routes/posts"
import { Route as IndexImport } from "./routes/index"
import { Route as PostsPostIdImport } from "./routes/posts/$postId"
import { Route as PostsIndexImport } from "./routes/posts/index"

but produced without this change:

import { Route as rootRoute } from "./routes/__root"
import { Route as PostsImport } from "./routes/posts"
import { Route as IndexImport } from "./routes"
import { Route as PostsPostIdImport } from "./routes/posts/$postId"
import { Route as PostsIndexImport } from "./routes/posts"

which would obviously fail because of the wrong import of the PostIndexRoute

SaiKai avatar Jan 11 '24 23:01 SaiKai