Home

Published

- 1 min read

Experimenting with ESbuild

img of Experimenting with ESbuild

I am collecting a couple of helper functions into a library @codeandchaos/utility-belt. It is at the moment a library for my personal use, without any consideration of long-term support.

NPM Package

To not block any useful package name. I decided to create a scoped package.

For this, you have to first create an organization. Then when you publish your package for the first time use the command --access public

npm publish --access public

NPM Package

ES build

I wanted to try out the new bundler ES Build. The build is fast as promised. My project is a library, it would be good to provide type declarations.

I did not find any setup instructions in the documentation. The only thing I found was this issue on github: support to output declaration files or .dts on build or service.transform

The issue is ‘closed’ because “This is not something that I’m planning to support.”

You could generate the files using the typescript compiler using the flag --emitDeclarationOnly.

My initial setup generated files incompatible with the ES Build output.

While I could have spent some time debugging and set it up . For now, I decided to only use the typescript compiler instead of bundling.