Enable minification to reduce bundle size#336
Conversation
- Add minify: true to tsdown.config.ts - Removes comments from bundle while preserving JSDoc in source - Reduces bundle size from 711 B to 708 B Closes #335
🦋 Changeset detectedLatest commit: a89def5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Deployment failed with the following error: Learn More: https://vercel.com/yamcodes?upgradeToPro=build-rate-limit |
WalkthroughA configuration property was added to enable minification and a changeset was added documenting the patch release. The build configuration now includes Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Bundle Size Report
✅ All size limits passed! |
commit: |
- Added minification to the build process, decreasing the bundle size from 711 B to 708 B. - Comments are removed from the bundle while preserving JSDoc in the source files. This change enhances performance by optimizing the output size.
|
Deployment failed with the following error: Learn More: https://vercel.com/yamcodes?upgradeToPro=build-rate-limit |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## arkenv@0.7.4 ### Patch Changes - #### Enable minification to reduce bundle size _[`#336`](#336) [`7236cb2`](7236cb2) [@yamcodes](https://github.com/yamcodes)_ Enable minification in build output. Reduces bundle size from 711 B to 708 B. Comments are removed from the bundle but remain in source files. - #### Fix browser compatibility by replacing `util.styleText` with cross-platform ANSI codes _[`#290`](#290) [`bf465de`](bf465de) [@yamcodes](https://github.com/yamcodes)_ Replace Node.js `util.styleText` with cross-platform ANSI color codes to fix the "Module 'node:util' has been externalized for browser compatibility" error in browser environments. The library still maintains zero dependencies! **Changes:** - Replaced `node:util.styleText` with custom ANSI implementation - Added environment detection (uses ANSI in Node, plain text in browsers) - Respects `NO_COLOR`, `CI` environment variables, and TTY detection - Organized utilities into `lib/` folder with comprehensive tests ```ts // No longer throws "node:util has been externalized" error import { createEnv } from "arkenv"; const env = createEnv({ VITE_API_URL: "string", VITE_PORT: "number.port", }); ``` ## @arkenv/vite-plugin@0.0.15 ### Patch Changes <details><summary>Updated 1 dependency</summary> <small> [`7236cb2`](7236cb2) [`bf465de`](bf465de) </small> - `arkenv@0.7.4` </details> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [arkenv](https://arkenv.js.org) ([source](https://redirect.github.com/yamcodes/arkenv)) | [`0.7.3` -> `0.7.4`](https://renovatebot.com/diffs/npm/arkenv/0.7.3/0.7.4) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>yamcodes/arkenv (arkenv)</summary> ### [`v0.7.4`](https://redirect.github.com/yamcodes/arkenv/releases/tag/arkenv%400.7.4) [Compare Source](https://redirect.github.com/yamcodes/arkenv/compare/arkenv@0.7.3...arkenv@0.7.4) ##### Patch Changes - #### Enable minification to reduce bundle size *[`#336`](https://redirect.github.com/yamcodes/arkenv/pull/336) [`7236cb2`](https://redirect.github.com/yamcodes/arkenv/commit/7236cb25de07f7afcc571dd3364b1507544de523) [@​yamcodes](https://redirect.github.com/yamcodes)* Enable minification in build output. Reduces bundle size from 711 B to 708 B. Comments are removed from the bundle but remain in source files. - #### Fix browser compatibility by replacing `util.styleText` with cross-platform ANSI codes *[`#290`](https://redirect.github.com/yamcodes/arkenv/pull/290) [`bf465de`](https://redirect.github.com/yamcodes/arkenv/commit/bf465dee26cd20619455bcc77f66424ca48da0fe) [@​yamcodes](https://redirect.github.com/yamcodes)* Replace Node.js `util.styleText` with cross-platform ANSI color codes to fix the "Module 'node:util' has been externalized for browser compatibility" error in browser environments. The library still maintains zero dependencies! **Changes:** - Replaced `node:util.styleText` with custom ANSI implementation - Added environment detection (uses ANSI in Node, plain text in browsers) - Respects `NO_COLOR`, `CI` environment variables, and TTY detection - Organized utilities into `lib/` folder with comprehensive tests ```ts // No longer throws "node:util has been externalized" error import { createEnv } from "arkenv"; const env = createEnv({ VITE_API_URL: "string", VITE_PORT: "number.port", }); ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on friday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/yamcodes/arkenv). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
This PR enables minification in the build process to reduce bundle size by removing comments and minifying code.
Changes
minify: truetotsdown.config.tsResults
Notes
JSDoc comments are preserved in source files for TypeScript type checking and IDE hints, but are stripped from the bundle during minification.
Closes #335
Summary by CodeRabbit