Skip to content

Commit 70f7db0

Browse files
committed
fix: package main should be cjs format. (fixes #869)
- Add module entry for esm in package.json See https://rollupjs.org/guide/en/#publishing-es-modules: > To make sure your ES modules are immediately usable by tools that work > with CommonJS such as Node.js and webpack, you can use Rollup to > compile to UMD or CommonJS format, and then point to that compiled > version with the main property in your package.json file. If your > package.json file also has a module field, ES-module-aware tools like > Rollup and webpack 2+ will import the ES module version directly.
1 parent a2b3edf commit 70f7db0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"prepare": "husky install",
1414
"test": "jest"
1515
},
16-
"main": "dist/react-tooltip.esm.min.js",
16+
"main": "dist/react-tooltip.cjs.min.js",
17+
"module": "dist/react-tooltip.esm.min.js",
1718
"buildFormats": [
1819
{
1920
"file": "dist/react-tooltip.umd.js",

0 commit comments

Comments
 (0)