Skip to content

fix: reduce bundle size of function script#42

Merged
remiposo merged 1 commit into
mainfrom
fix/reduce-bundle-size-of-function-script
Jun 11, 2025
Merged

fix: reduce bundle size of function script#42
remiposo merged 1 commit into
mainfrom
fix/reduce-bundle-size-of-function-script

Conversation

@remiposo

@remiposo remiposo commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

In kysely-codegen@0.18, support for config files via cosmiconfig was introduced.
https://github.com/RobinBlomberg/kysely-codegen#configuration-file

However, cosmiconfig uses dynamic imports to load typescript (likely to support .ts config files), which causes typescript to be included in the bundle. This significantly increases the bundle size.

Since the config file feature is not used in this use case, we’ve mocked cosmiconfig, similar to how git-diff was handled.
This avoids the bundling issue and ensures the script stays within the Tailor Platform's size limits.

As a result, the bundle size was reduced from 4.1MB to 657KB.

@remiposo
remiposo marked this pull request as ready for review June 11, 2025 06:22
@remiposo
remiposo requested a review from a team as a code owner June 11, 2025 06:22

@dragon3 dragon3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@remiposo
remiposo merged commit 373aad5 into main Jun 11, 2025
6 checks passed
@remiposo
remiposo deleted the fix/reduce-bundle-size-of-function-script branch June 11, 2025 06:27
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.

3 participants