Skip to content

Commit

Permalink
fix: add esm exports to package.json and change esm bundle extension …
Browse files Browse the repository at this point in the history
…to .mjs to allow node.js to properly import esm version of package. (#989)
  • Loading branch information
zewish authored Dec 15, 2023
1 parent 09af825 commit e4a3718
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/component/.size-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"minified": 7394,
"gzipped": 2621
},
"dist/loadable.esm.js": {
"dist/loadable.esm.mjs": {
"bundled": 16434,
"minified": 7090,
"gzipped": 2552,
Expand Down
11 changes: 9 additions & 2 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"name": "@loadable/component",
"description": "React code splitting made easy.",
"version": "5.15.3",
"main": "dist/loadable.cjs.js",
"module": "dist/loadable.esm.js",
"main": "./dist/loadable.cjs.js",
"module": "./dist/loadable.esm.mjs",
"exports": {
".": {
"require": "./dist/loadable.cjs.js",
"import": "./dist/loadable.esm.mjs",
"default": "./dist/loadable.cjs.js"
}
},
"repository": "[email protected]:gregberge/loadable-components.git",
"author": "Greg Bergé <[email protected]>",
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/__fixtures__/stats.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"errors": [],
"warnings": [],
"hash": "84e08a1809b7b09283e2",
"hash": "6cacb38ddc45b9bbd140",
"publicPath": "/dist/node/",
"outputPath": "../../examples/server-side-rendering/public/dist/node",
"assetsByChunkName": {
Expand Down

0 comments on commit e4a3718

Please sign in to comment.