Open xiangnanscu opened 1 year ago
say I've a file @/globals/index.mjs whose content is:
@/globals/index.mjs
export { Model } from "@/lib/model.mjs"; export * as utils from "@/lib/utils.mjs";
utils can't be auto imported because when I use code like console.log({Model, utils}) will get error ReferenceError: utils is not defined.
utils
console.log({Model, utils})
ReferenceError: utils is not defined
But this works:
export { Model } from "@/lib/model.mjs"; import * as utils from "@/lib/utils.mjs"; export { utils };
Is this normal?
https://github.com/antfu/unplugin-auto-import
System: OS: Windows 10 10.0.19045 CPU: (12) x64 AMD Ryzen 5 5600G with Radeon Graphics Memory: 22.65 GB / 39.30 GB Binaries: Node: 18.12.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
npm
Can you provide a minimal reproducible example to help us find some clue?
Describe the bug
say I've a file
@/globals/index.mjs
whose content is:utils
can't be auto imported because when I use code likeconsole.log({Model, utils})
will get errorReferenceError: utils is not defined
.But this works:
Is this normal?
Reproduction
https://github.com/antfu/unplugin-auto-import
System Info
Used Package Manager
npm
Validations