Skip to content

Conversation

@simon04
Copy link

@simon04 simon04 commented May 29, 2025

This allows users of this library to import the TypeScript source files, and perform compilation and minification with their own settings.

In simon04/eaws-bulletin-map@5f75aef this resulted in a 6kB smaller bundle:

 dist/index.html                   0.47 kB │ gzip:   0.30 kB
 dist/assets/index-Bi09qgfC.css  143.10 kB │ gzip:  24.07 kB
-dist/assets/index-xR2o_V3-.js   453.12 kB │ gzip: 130.74 kB │ map: 2,639.08 kB
+dist/assets/index-CM3X7QSA.js   447.45 kB │ gzip: 128.68 kB │ map: 2,647.57 kB

@bdon
Copy link
Member

bdon commented May 29, 2025

Please provide some context on what problem this solves.

@simon04
Copy link
Author

simon04 commented Jun 1, 2025

Hi, I've added some context to the description (should have done right at the beginning).

@bdon
Copy link
Member

bdon commented Jun 2, 2025

I don't believe this is a best practice to export both TypeScript in src and the transpiled .js + .dts in dist, because we need to make the single build output work for plain Javascript dependent projects.

Can you identify a popular NPM-distributed project that ships all of .ts + .js + .dts that we could refer to?

The 6kb savings is significant, though after compression it's only 2kb. Maybe there is a different way we configure our TypeScript build to get that 2kb savings.

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.

2 participants