fix(studio): use tsx/esm loader for vite build to resolve .ts imports#1298
Open
zubaier-create wants to merge 1 commit into
Open
fix(studio): use tsx/esm loader for vite build to resolve .ts imports#1298zubaier-create wants to merge 1 commit into
zubaier-create wants to merge 1 commit into
Conversation
Node's native ESM loader rejects `.ts` file extensions when Vite loads the config, which causes `@hyperframes/core/fonts/aliases` to fail with ERR_UNKNOWN_FILE_EXTENSION. Prefixing vite build with `node --import tsx/esm` lets Node resolve TypeScript source exports during the build, unblocking `packages/studio` and the downstream CLI build that bundles the studio dist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
packages/studio/package.jsonbuild script changed from:to:
Why
When Vite loads
vite.config.ts, it imports workspace packages via theirexportsmap. In development mode,@hyperframes/coremaps subpath exports (e.g../fonts/aliases) directly to.tssource files. Node's native ESM loader rejects.tsextensions, throwing:Prefixing the build command with
node --import tsx/esmregisters the tsx loader before Vite starts, so Node can resolve and transpile TypeScript source exports during config load. This unblocks the studio build and, downstream, the CLI build which bundles the studiodist/.Testing