PMTiles icon indicating copy to clipboard operation
PMTiles copied to clipboard

Allow to import non minified files from src

Open simon04 opened this issue 7 months ago • 3 comments

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

In https://github.com/simon04/eaws-bulletin-map/commit/5f75aef08976a565c9002ff4c7a9fc570d10cc78 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

simon04 avatar May 29 '25 14:05 simon04

Please provide some context on what problem this solves.

bdon avatar May 29 '25 21:05 bdon

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

simon04 avatar Jun 01 '25 06:06 simon04

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.

bdon avatar Jun 02 '25 15:06 bdon