vite-plugin-dynamic-import icon indicating copy to clipboard operation
vite-plugin-dynamic-import copied to clipboard

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

Open jiadesen opened this issue 2 years ago • 1 comments

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:
        ....

jiadesen avatar Oct 12 '23 10:10 jiadesen

Okay! thanks for your feedback :)

caoxiemeihao avatar Oct 13 '23 02:10 caoxiemeihao