-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Configure tsup for build process #7
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
Conversation
This commit introduces a tsup.config.ts file to centralize the build configuration for the project. The build and dev scripts in package.json have been updated to simply invoke tsup, leveraging the new configuration file for detailed build settings.
WalkthroughThe build process was refactored by moving detailed Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant NPM Scripts
participant tsup
participant tsup.config.ts
participant Output Files
Developer->>NPM Scripts: Run "npm run build" or "npm run dev"
NPM Scripts->>tsup: Invoke tsup (no explicit args)
tsup->>tsup.config.ts: Load configuration
tsup.config.ts-->>tsup: Provide entry, formats, dts, banner, etc.
tsup->>Output Files: Build outputs with banner and types
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tsup.config.ts (1)
4-17: Minor build-quality tweaks you might want
sourcemap: true– helps consumers debug.target: 'es2019'(or whichever baseline you support) – avoids oversized output.minify: truefor production builds if bundle size matters.None are blockers, but worth considering before publishing v0.0.3+.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
package.json(1 hunks)tsup.config.ts(1 hunks)
🔇 Additional comments (2)
package.json (1)
20-21: Scripts now defer to default config – looks goodMoving the detailed build parameters out of the command line and into
tsup.config.tsmakes the scripts cleaner and less repetitive. No functional issues spotted in these two lines.tsup.config.ts (1)
2-2: No change needed: bare JSON import is safe in tsup.config.tsTsup loads your TypeScript config via its built-in esbuild register hook, which transpiles
import pkg from './package.json';into a CJS
require('./package.json')under the hood. Even with"type": "module"in package.json, your tsup config runs as CommonJS, so you don’t need anassert { type: "json" }.Likely an incorrect or invalid review comment.
This commit introduces a tsup.config.ts file to centralize the build configuration for the project.
The build and dev scripts in package.json have been updated to simply invoke tsup,
leveraging the new configuration file for detailed build settings.
Summary by CodeRabbit