nalgeon/iuliia-js

Remove "browser" bundle

corporateanon opened this issue · 1 comments

There are 3 bundles currently:

  • node (./dist/node/)
  • browser (./dist/browser/)
  • UMD (./dist/umd/)

The only differences between browser and node bundles are:

Feature Browser Node
Comments no yes
Source Maps yes no

But since browser bundle is never going to be used directly (it is the same CommonJS an node bundle, so users are importing it with client assets bundles like Webpack, Esbuild etc), it is safe to have comments there, because client bundles will strip them anyway. The same goes with the sourcemaps - they might be useful in Node.js environment for debugging, stack tracing etc.

Also it doesn't seem that files from ./dist/browser folder have been ever used by anyone, because there is no special hint in package.json for client asset bundlers:

"browser": "./dist/browser/index.js"

Instead there's only:

"main": "dist/node/index.js"

So I suggest to remove browser bundle.

Browser bundle was used by Rollup to create UMD bundle:

rollup dist/browser/index.js --file dist/umd/iuliia.js --format umd --name iuliia

Now there is a separate tsconfig for UMD bundle, so I don't see the need for a browser bundle.