Skip to content

Commit

Permalink
Fix Node.js ESM/CJS interoperability
Browse files Browse the repository at this point in the history
Merge pull request #73 from akuntsch/esm-cjs-interop
  • Loading branch information
leeoniya authored Jan 6, 2025
2 parents 967a82b + 56b8f91 commit e8f3a3c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/uFuzzy.cjs.js → dist/uFuzzy.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2024, Leon Sorokin
* Copyright (c) 2025, Leon Sorokin
* All rights reserved. (MIT Licensed)
*
* uFuzzy.js (μFuzzy)
Expand Down
2 changes: 1 addition & 1 deletion dist/uFuzzy.iife.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2024, Leon Sorokin
* Copyright (c) 2025, Leon Sorokin
* All rights reserved. (MIT Licensed)
*
* uFuzzy.js (μFuzzy)
Expand Down
2 changes: 1 addition & 1 deletion dist/uFuzzy.esm.js → dist/uFuzzy.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2024, Leon Sorokin
* Copyright (c) 2025, Leon Sorokin
* All rights reserved. (MIT Licensed)
*
* uFuzzy.js (μFuzzy)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@leeoniya/ufuzzy",
"version": "1.0.17",
"description": "A tiny, efficient fuzzy matcher that doesn't suck",
"main": "./dist/uFuzzy.cjs.js",
"module": "./dist/uFuzzy.esm.js",
"main": "./dist/uFuzzy.cjs",
"module": "./dist/uFuzzy.mjs",
"types": "./dist/uFuzzy.d.ts",
"type": "module",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function bannerlessESM() {
},
load(id) {
if (id == 'uFuzzy')
return fs.readFileSync('./dist/uFuzzy.esm.js', 'utf8').replace(/\/\*\*.*?\*\//gms, '');
return fs.readFileSync('./dist/uFuzzy.mjs', 'utf8').replace(/\/\*\*.*?\*\//gms, '');
return null;
}
};
Expand All @@ -54,7 +54,7 @@ export default [
input: './src/uFuzzy.mjs',
output: {
name: 'uFuzzy',
file: './dist/uFuzzy.esm.js',
file: './dist/uFuzzy.mjs',
format: 'es',
banner,
},
Expand All @@ -63,7 +63,7 @@ export default [
input: './src/uFuzzy.mjs',
output: {
name: 'uFuzzy',
file: './dist/uFuzzy.cjs.js',
file: './dist/uFuzzy.cjs',
format: 'cjs',
exports: "auto",
banner,
Expand Down Expand Up @@ -96,4 +96,4 @@ export default [
terser(terserOpts),
]
},
];
];

0 comments on commit e8f3a3c

Please sign in to comment.