Closed hassanzohdy closed 1 year ago
Could you be more specific
Yup, you can check this with all the info needed
@caoxiemeihao Any recommendations about it
const aliases = {
- apps: "/src/apps",
+ apps: path.join(__dirname, "src/apps"),
};
vite-plugin-dynamic-import
always based on file system paths, /src/apps
will be treated as the absolute path to the file, nott the root directory of the Vite project.
apps: "/src/apps"
importer: /Users/atom/Desktop/issues/vite-plugin-dynamic-import-37/src/main.tsx
importee: /src/apps
↓↓↓↓ After calculation ↓↓↓
../../../../../../src/apps ❌
apps: path.join(__dirname, "src/apps")
importer: /Users/atom/Desktop/issues/vite-plugin-dynamic-import-37/src/main.tsx
importee: /Users/atom/Desktop/issues/vite-plugin-dynamic-import-37/src/apps
↓↓↓↓ After calculation ↓↓↓
./apps ✅
Hello,
I was wondering if there any chance to have this plugin work with dynamic import and absolute paths, that was really good to me when working with CRA, i suppose this is supported by webpack or so, but any idea of how getting this done.
Thanks in advance