npm-package-template icon indicating copy to clipboard operation
npm-package-template copied to clipboard

Question on build targets

Open dhowe opened this issue 2 years ago • 1 comments

Greetings and thanks for the template. This is just a question re: the target build formats. I notice that there are 4 targets in the rollup-config: es, es5, iife, and cjs. And in package.json I see the three outputs: "main": "dist/index.cjs.js", "browser": "dist/index.iife.js", "exports": "./dist/index.js"

I'm guessing cjs for npm/node and iife for the browser. Where do you imagine that the two es formats would be used/published ?

dhowe avatar Oct 25 '23 10:10 dhowe

Hey @dhowe big apologies, I somehow did not see this issue being opened. I will have to review and redo the exports since the last time I worked on this I had a much less understanding of the different output environments.

My goal is to provide multiple outputs to support the following with each different outputs:

  • modern browsers
  • legacy browsers
  • modern node
  • legacy node
  • bun
  • deno

I'd like to avoid multi target outputs such as UMD but rather do specific builds for each target

jankapunkt avatar Feb 04 '25 07:02 jankapunkt