vite-plugin / vite-plugin-dynamic-import

Enhance Vite builtin dynamic import
https://www.npmjs.com/package/vite-plugin-dynamic-import
MIT License
193 stars 11 forks source link

Dynamic import not working Windows #68

Open christoph-bessei opened 11 months ago

christoph-bessei commented 11 months ago

In version 1.2.7 dynamic imports are working fine on Windows, but starting from 1.3.0 there's an issue (maybe a regression of #38?).

1.2.7

Dynamic imports are working on Windows, macOS & Ubuntu 22.04.

>= 1.3.0

Starting from 1.3.0 (same issue in 1.4.x & 1.5.0 I get the following error messages:

[vite-plugin-dynamic-import] no files matched: import(`@/components/icon/${path}/${upperFirstName}`)
   file: C:\Users\chris\Documents\demo\src\mixins\iconLoadMixin.js             
[vite-plugin-dynamic-import] no files matched: import(`@/components/cms/${type}`)     
   file: C:\Users\chris\Documents\demo\src\mixins\cmsJsonMixin.js

The same repository works just fine with macOS & Ubuntu 22.04, it it's probably related to the Windows path separator.

Please let me know if you need anything to reproduce the issue.

yejimeiming commented 11 months ago

Yep! I need a minimal reproduction repo here :)