Skip to content

Commit

Permalink
build: backward compatible cjs entry (resolves #110)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 24, 2023
1 parent 4111333 commit 3c8c880
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
11 changes: 11 additions & 0 deletions lib/defu.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { defu, createDefu, defuFn, defuArrayFn } = require('../dist/defu.cjs');

module.exports = defu;

module.exports.defu = defu;
module.exports.default = defu;

module.exports.createDefu = createDefu;
module.exports.defuFn = defuFn;
module.exports.defuArrayFn = defuArrayFn;

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
"exports": {
".": {
"types": "./dist/defu.d.ts",
"require": "./dist/defu.cjs",
"import": "./dist/defu.mjs"
"import": "./dist/defu.mjs",
"require": "./lib/defu.cjs"
}
},
"main": "./dist/defu.cjs",
"main": "./lib/defu.cjs",
"module": "./dist/defu.mjs",
"types": "./dist/defu.d.ts",
"files": [
"dist"
"dist",
"lib"
],
"scripts": {
"build": "unbuild",
Expand Down

0 comments on commit 3c8c880

Please sign in to comment.