-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
Reproduction
- Open StackBlitz
- Run
npx unbuild
- Inspect the output files:
-
dist/common/fn.js
(all correctly transformed)
-
dist/runtime/fn.js
(import fromsrc/common/
wasn't transformed)
Describe the bug
mkdist has built-in functionality for resolving relative imports, and it works great. You can see this in the dist/common/fn.js
file.
import { COMMON_CONFIG } from "./config/index.js"; // correctly transformed
export const getConfig = () => {
return COMMON_CONFIG;
};
Unfortunately, this functionality doesn't work when multiple entries
are specified. This is evident in the dist/runtime/fn.js
file. In that file, the import from src/runtime/
is correctly transformed, but the import from src/common/
remains unchanged.
import { COMMON_CONFIG } from "../common/config"; // wasn't transformed
import { RUNTIME_CONFIG } from "./config/index.js"; // correctly transformed
export const getCommonConfig = () => {
return COMMON_CONFIG;
};
export const getRuntimeConfig = () => {
return RUNTIME_CONFIG;
};
Is there a way to configure unbuild
so that it properly resolves extensions when using multiple entries
?
Additional context
No response
Logs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working