Skip to content

Conversation

@martincostello
Copy link

Minify the contents of dist and generate a source map.

Reduces the total size of dist by ~48%.

Before

> ncc build src/index.ts --license licenses.txt

ncc: Version 0.38.4
ncc: Compiling file index.js into CJS
ncc: Using [email protected] (local user-provided)
   1kB  dist\licenses.txt
   7kB  dist\606.index.js
3416kB  dist\index.js
3424kB  [3967ms] - ncc 0.38.4

After

> ncc build src/index.ts --license licenses.txt --minify --source-map

ncc: Version 0.38.4
ncc: Compiling file index.js into CJS
ncc: Using [email protected] (local user-provided)
   1kB  dist\licenses.txt
   7kB  dist\606.index.js
  29kB  dist\index.js.map
  29kB  dist\index.js.map
  40kB  dist\sourcemap-register.js
1711kB  dist\index.js
1788kB  [5849ms] - ncc 0.38.4

Minify the contents of `dist` and generate a source map.
Copilot AI review requested due to automatic review settings November 4, 2025 11:51
@martincostello martincostello requested a review from a team as a code owner November 4, 2025 11:51
Copy link

Copilot AI left a comment

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 enhances the build process by enabling minification and source map generation for the compiled distribution files. The package script now includes --minify and --source-map flags when building with ncc.

  • Added minification and source map generation to the build process
  • Generated corresponding dist files (sourcemap-register.js and index.js.map)

Reviewed Changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.

File Description
package.json Updated the "package" script to include --minify and --source-map flags
dist/sourcemap-register.js Auto-generated minified source map registration utility
dist/index.js.map Auto-generated source map for the main index.js bundle

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant