For a JS library which is published in a structure like ...
my-package\
dist\
my-package.cjs.js
my-package.cjs.min.js
my-package.cjs.min.js.map
my-package.esm.js
my-package.esm.min.js
my-package.esm.min.js.map
my-package.umd.js
my-package.umd.min.js
my-package.umd.min.js.map
package.json
E.g. built to CJS, ESM, and UMD bundles, each having a "source", minified and map file.
package.json
{ // ...
"main": "dist/my-package.cjs.js",
"module": "dist/my-package.esm.js",
"browser": "dist/my-package.umd.js"
}
My assumption is that these properties should point to the "source" file, and tools used to bundle my library (e.g. Webpack) into an external project are smart enough to choose the minified file if the build is non-debug/non-dev mode.
Or, am I wrong and these properties should point to the minified file?