Skip to content

refactor: remove prebundle setup - #1771

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/refactor-remove-prebundle
Jul 17, 2026
Merged

chenjiahan merged 1 commit into
mainfrom
chenjiahan/refactor-remove-prebundle

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR removes the prebundle step and generated compiled directories from Rslib packages, reducing release maintenance and avoiding shipping prebundled dependencies.

  • Inline the minimal color helper used by core.
  • Bundle tsconfig-paths lazily through a dynamic import, with the ESM require shim and a CommonJS json5 alias.
  • Remove prebundle scripts and configuration, and exclude compiled from published files.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings July 17, 2026 09:52
@chenjiahan
chenjiahan requested a review from Timeless0911 July 17, 2026 09:55
@chenjiahan
chenjiahan enabled auto-merge (squash) July 17, 2026 09:55
@chenjiahan
chenjiahan merged commit f2371ea into main Jul 17, 2026
12 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/refactor-remove-prebundle branch July 17, 2026 09:56

Copilot AI 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.

Pull request overview

This PR removes the prebundle workflow and the generated compiled/ directories from Rslib packages, aiming to reduce release/maintenance overhead and avoid shipping prebundled dependencies. It replaces the previous prebundled/aliased approach with a small inlined color helper in @rslib/core, and a lazy tsconfig-paths load path for rsbuild-plugin-dts.

Changes:

  • Remove prebundle scripts/config and stop publishing compiled/ directories from package artifacts.
  • Inline a minimal color helper in @rslib/core instead of re-exporting it from rslog.
  • Make tsconfig-paths load lazily via dynamic import, and adjust bundling config (ESM require shim + json5 alias) accordingly.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Drops prebundle (and related transitive deps) from the lockfile.
packages/plugin-dts/tsconfig.json Removes the paths mapping that pointed to ./compiled/tsconfig-paths.
packages/plugin-dts/src/utils.ts Switches tsconfig-paths usage to a lazy dynamic import when redirects are enabled.
packages/plugin-dts/rslib.config.ts Adds ESM require shim and json5$ alias to support bundling/interop after removing prebundle.
packages/plugin-dts/prebundle.config.ts Removes prebundle configuration (file deleted).
packages/plugin-dts/package.json Stops publishing compiled/ and removes the prebundle script.
packages/core/src/utils/color.ts Replaces rslog color re-export with an inlined node:util-based styler.
packages/core/rslib.config.ts Removes the dts.alias that referenced prebundled rslog types.
packages/core/prebundle.config.ts Removes prebundle configuration (file deleted).
packages/core/package.json Stops publishing compiled/ and removes the prebundle script.
package.json Removes root prebundle script and stops running it from prepare.
CONTRIBUTING.md Updates contributor docs to reflect prepare no longer runs prebundle.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

let matchPath: MatchPath | undefined;

if (redirect.path || redirect.extension) {
const { createMatchPath, loadConfig } = await import('tsconfig-paths');
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