-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
@actions/core
support tree shaking when bundled in a GitHub Action.
#1436
Comments
While waiting for this issue to be addressed, I've published a fork of
|
Hello @actions/actions-runtime, Is someone still working on this instead of using fork package? |
@kamontat Should we submit a ADR as part of the Enhancements and Feature Requests to progress this issue? |
Hi @robherley, I saw that you is a @actions engineers. |
Describe the enhancement
At the moment, when using
@actions/core
npm package in your own bundled GitHub action, the bundler is unable to tree shake unused code from@actions/core
.Additional information
If we do the below, it should help most bundlers to determine what can be removed from
@actions/core
when bundling.Add to
packages/core/package.json
Arrow Functions
Along with using arrow functions instead of the traditional function expression
to
Entry point
Add a
packages/core/src/index.ts
entry point that individuals exports.For example
Circular dependency issue
The 'import' structure also has a circular dependency issue, where files sometimes import each other.
For example
core.ts
andoidc-utils.ts
import each other.Refactoring the structure of files and function usage would resolve this issue and help with tree shaking when bundling.
The text was updated successfully, but these errors were encountered: