8000 Core: Tweak factory exports details · jquery/jquery@86e62a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86e62a3

Browse files
committed
Core: Tweak factory exports details
After this commit: 1. Node.js always gets the CommonJS version 2. Bundlers always get the ESM version 3. Other tools take the ESM version when using `import` and the CommonJS when using `require`. The complexity is lower than for the `.` & `./slim` entry points because there's no default export to handle so node/bundler wrapper files are not necessary.
1 parent c94ff35 commit 86e62a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
},
3232
"./factory": {
3333
"node": "./dist/jquery.factory.js",
34-
"default": "./dist-module/jquery.factory.module.js"
34+
"module": "./dist-module/jquery.factory.module.js",
35+
"import": "./dist-module/jquery.factory.module.js",
36+
"default": "./dist/jquery.factory.js"
3537
},
3638
"./factory-slim": {
3739
"node": "./dist/jquery.factory.slim.js",
38-
"default": "./dist-module/jquery.factory.slim.module.js"
40+
"module": "./dist-module/jquery.factory.slim.module.js",
41+
"import": "./dist-module/jquery.factory.slim.module.js",
42+
"default": "./dist/jquery.factory.slim.js"
3943
},
4044
"./src/*.js": "./src/*.js"
4145
},

0 commit comments

Comments
 (0)
0