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

Don't bundle build output #835

Closed
2 tasks done
matejchalk opened this issue Oct 11, 2024 · 0 comments · Fixed by #811
Closed
2 tasks done

Don't bundle build output #835

matejchalk opened this issue Oct 11, 2024 · 0 comments · Fixed by #811

Comments

@matejchalk
Copy link
Collaborator

matejchalk commented Oct 11, 2024

The problem

Currently, our packages are bundled with ESBuild. This has some strange consequences.

For example, although @code-pushup/cli depends on other packages like @code-pushup/utils via dependencies in package.json, the distributed cli package actually doesn't import any of our other packages, their code is included in the index.js or bin.js bundle. The reason ESBuild doesn't treat other @code-pushup packages as external dependencies is because the imports are treated as relative paths after resolving TypeScript path aliases.

This leads to weird cases like the #834 bug - the @code-pushup/cli source code doesn't directly import vscode-material-icons (hence why it should be OK that it's not in its package.json), but in the bundled code it is imported directly (hence why Yarn 4 complains about it).

Also, bundling the package into one huge file makes it harder to diagnoze errors reported by customers, because the error stack just shows some random line in the massive index.js file, so it's harder to link to our source code.

Proposal

Our packages are for Node only, not the browser. Therefore it doesn't make sense to use a bundler. All we need is to transpile .ts files to .js and .d.ts files, so plain old tsc should suffice.

Acceptance criteria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants