Skip to content
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

extensions in routesFolder doesn't work the same as extensions in root config. #274

Open
ByScripts opened this issue Dec 18, 2023 · 0 comments
Labels
🐞 bug this isn't working as expected

Comments

@ByScripts
Copy link

When using this configuration:

    vueRouter({
      routesFolder: [
        {
          src: "src/pages",
          extensions: [".page.vue"]
        },
        {
          src: "src/stories",
          extensions: [".story.vue"]
        }
      ],
    }),

Generated type looks like that:

declare module 'vue-router/auto/routes' {
  export interface RouteNamedMap {
    '/foo.story': RouteRecordInfo<'/foo.story', '/foo/story', Record<never, never>, Record<never, never>>,
    '/index.page': RouteRecordInfo<'/index.page', '/index/page', Record<never, never>, Record<never, never>>,
    '/settings.page': RouteRecordInfo<'/settings.page', '/settings/page', Record<never, never>, Record<never, never>>,
  }
}

But when moving extensions to root config:

    vueRouter({
      routesFolder: [
        {
          src: "src/pages",
        },
        {
          src: "src/stories",
        }
      ],
      extensions: [".page.vue", ".story.vue"]
    })

Generated type looks like that:

declare module 'vue-router/auto/routes' {
  export interface RouteNamedMap {
    '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
    '/foo': RouteRecordInfo<'/foo', '/foo', Record<never, never>, Record<never, never>>,
    '/settings': RouteRecordInfo<'/settings', '/settings', Record<never, never>, Record<never, never>>,
  }
}
@posva posva added the bug label Dec 18, 2023
@settings settings bot removed the bug label Feb 21, 2024
@posva posva added the 🐞 bug this isn't working as expected label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug this isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants