Skip to content

[vite-plugin-dynamic-import] Generated runtime code has redundant judgment rules in some cases #66

Description

@jiadesen

For the following dynamic import

import(`./components/${singlePathName}/index.vue`)

If singlePathName is "A" or "B", in the following generated code, case "./components/A" and case "./components/A/index" are not necessary

switch (n) {
    case "./components/A":
    case "./components/A/index":
    case "./components/A/index.vue":
        return ...;
    case "./components/B":
    case "./components/B/index":
    case "./components/B/index.vue":
        return ...;
    default:
        ....

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions