Skip to content

Commit

Permalink
Modify build process to disable code splitting
Browse files Browse the repository at this point in the history
The code splitting feature in `tsup` breaks up source code into logical
modules so that if a module is not being used it can be removed by a
build tool that supports tree shaking.

However, the modules that `tsup` creates do not necessary match the
files in the original source code, and `tsup` gives them a random name.
This makes it frustrating for developers on a client team who are
debugging a `core` package by inspecting the compiled version, because
it is impossible to tell what a chunk file contains without first
opening it up.

This commit thus configures `tsup` to disable the code splitting
feature.
  • Loading branch information
mcmire committed Jun 27, 2024
1 parent 879280b commit 2255fa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const config: Options = {

// Split the output into chunks. This is useful for tree-shaking.
// https://tsup.egoist.dev/#code-splitting
splitting: true,
splitting: false,
};

export default config;

0 comments on commit 2255fa3

Please sign in to comment.