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

Named views without definePage should not generate an import in auto-routes #344

Open
posva opened this issue Mar 14, 2024 · 0 comments
Open
Labels
⚡️ enhancement improvement over an existing feature

Comments

@posva
Copy link
Owner

posva commented Mar 14, 2024

This should be the better fix for #338

currently, the playground generates this code:

import _definePage_default_0 from '/Users/posva/unplugin-vue-router/playground/src/pages/index.vue?definePage&vue'
import _definePage_named_1 from '/Users/posva/unplugin-vue-router/playground/src/pages/index@named.vue?definePage&vue'
import { _mergeRouteRecord } from 'unplugin-vue-router/runtime'


export const routes = [
  _mergeRouteRecord(
  {
    path: '/',
    name: 'home',
    components: {
      'default': () => import('/Users/posva/unplugin-vue-router/playground/src/pages/index.vue'),
      'named': () => import('/Users/posva/unplugin-vue-router/playground/src/pages/index@named.vue')
    },
    /* no children */
  },
  _definePage_default_0,
_definePage_named_1
  ),
// ...

Since index@named.vue doesn't have a definePage() inside it, it would be better if it was skipped completely

@posva posva added the ⚡️ enhancement improvement over an existing feature label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡️ enhancement improvement over an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant