Skip to content

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

Open
@posva

Description

@posva

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/[email protected]?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/[email protected]')
    },
    /* no children */
  },
  _definePage_default_0,
_definePage_named_1
  ),
// ...

Since [email protected] doesn't have a definePage() inside it, it would be better if it was skipped completely

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚡️ enhancementimprovement over an existing feature

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions