Skip to content

Commit

Permalink
fix: CJS fallbacks should be at the end not at beginning
Browse files Browse the repository at this point in the history
- when defining the old CJS `main` and `module`, these properties should come after `exports` (new ESM prop) so that newer NodeJS will try `exports` first (we shouldn't try the fallback first), while for old NodeJS it will automatically use the fallbacks since `exports` won't work, see this TypeScript for more info (https://www.typescriptlang.org/docs/handbook/esm-node.html)
  • Loading branch information
ghiscoding committed Jul 17, 2023
1 parent 9758f73 commit a244ada
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"name": "slickgrid",
"version": "4.0.1",
"description": "A lightning fast JavaScript grid/spreadsheet",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand All @@ -20,6 +18,8 @@
}
},
"types": "dist/types/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"directories": {
"example": "examples",
"test": "tests"
Expand Down

0 comments on commit a244ada

Please sign in to comment.