-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Describe the bug
I migrated a node.js project using tsdown to vite+ and noticed that tsdown's shims are not bundled with the vite+ installation. When running vp pack with shims: true the command fails because the build process cannot find node_modules/tsdown/esm-shims.js.
The shims are used for transforming __dirname and __filename references for ESM compatibility
In tsdown esm-shims.js is a static file currently sitting at the root of the repository
Reproduction
https://github.com/alexfigliolia/vite-plus-minimal-reproduction
Steps to reproduce
- Create a small node.js project and configure the vite+
packoptions to specifyshims: true. - Create file to build that uses the
__filenameor__dirnameglobal - Run
vp pack
System Info
VITE+ - The Unified Toolchain for the Web
Environment:
Version 24.14.0
Source lts
Tool Paths:
node /.vite-plus/js_runtime/node/24.14.0/bin/node
npm /.vite-plus/js_runtime/node/24.14.0/bin/npm
npx /.vite-plus/js_runtime/node/24.14.0/bin/npx
VITE+ - The Unified Toolchain for the Web
vp v0.1.12
Local vite-plus:
vite-plus v0.1.12
Tools:
vite v8.0.0
rolldown v1.0.0-rc.9
vitest v4.1.0
oxfmt v0.40.0
oxlint v1.55.0
oxlint-tsgolint v0.17.0
tsdown v0.21.3
Environment:
Package manager yarn v4.0.2
Node.js Not foundUsed Package Manager
yarn
Logs
error: Build failed with 1 error:
[UNRESOLVED_IMPORT] Error: Could not resolve '<project>/node_modules/@voidzero-dev/vite-plus-core/dist/esm-shims.js' in <project>/<file-using-__dirname-or__filename>Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackPriority
None yet
Effort
None yet