Skip to content

Commit 7506e9d

Browse files
committed
refactor: replace UMD output with CJS and simplify ESM artifacts
Remove the duplicate .mjs ESM output and replace the UMD dist with a dedicated CJS build. Remove the "browser" condition from the exports map, which caused default imports to resolve as undefined in browser-targeted resolvers such as Webpack 5 and Rollup (closes #38).
1 parent 7b70ced commit 7506e9d

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@
3131
"type": "module",
3232
"exports": {
3333
".": {
34-
"import": "./dist/esm/jquery-param.mjs",
35-
"require": "./dist/umd/jquery-param.js",
36-
"browser": "./jquery-param.min.js"
34+
"import": "./dist/esm/jquery-param.js",
35+
"require": "./dist/cjs/jquery-param.cjs"
3736
}
3837
},
39-
"main": "dist/umd/jquery-param.js",
40-
"module": "dist/esm/jquery-param.mjs",
38+
"main": "./dist/cjs/jquery-param.cjs",
39+
"module": "./dist/esm/jquery-param.js",
4140
"browser": "jquery-param.min.js",
4241
"sideEffects": false,
4342
"files": [

rollup.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export default [
55
input: 'src/index.js',
66
output: [
77
{ file: 'dist/esm/jquery-param.js', format: 'es' },
8-
{ file: 'dist/esm/jquery-param.mjs', format: 'es' },
9-
{ file: 'dist/umd/jquery-param.js', format: 'umd', name: 'param' },
8+
{ file: 'dist/cjs/jquery-param.cjs', format: 'cjs' },
109
{ file: 'jquery-param.min.js', format: 'umd', name: 'param' }
1110
],
1211
plugins: [terser()]

0 commit comments

Comments
 (0)