Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👻 Update the shared workspace to build to esm and commonjs #193

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ibolton336
Copy link
Member

@ibolton336 ibolton336 commented Jan 13, 2025

Resolves #192

Vite Library Mode Integration:

  • Enables efficient bundling of the shared package using Vite, producing both CommonJS (CJS) and ES Module (ESM) outputs. This setup ensures compatibility with modern and legacy environments for seamless use in both the VSCode extension and webview packages.

@ibolton336 ibolton336 requested a review from a team as a code owner January 13, 2025 17:42
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use vite library mode? https://vite.dev/guide/build#library-mode

From what I can tell, esbuild comes in from @vitejs/plugin-react, but I could be wrong. Would be good to have the builders/packagers used all explicity listed as devDependencies in the approriate package.json files.

Probably can also remove:

"references": [
{ "path": "./shared" },
{ "path": "./vscode" },
{ "path": "./webview-ui" }
]

and:

"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"

@ibolton336 ibolton336 changed the title 👻 Add esbuild script for esm / commonjs shared builds 👻 Add vite build step for shared package Jan 13, 2025
@ibolton336 ibolton336 changed the title 👻 Add vite build step for shared package 👻 Update the shared workspace to build to esm and commonjs Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the shared workspace to build to esm and commonjs
2 participants