Skip to content

Commit

Permalink
refactor: remove unused Rollup plugins and switch to ES module export…
Browse files Browse the repository at this point in the history
… for unitFlip
  • Loading branch information
zshaian committed Dec 23, 2024
1 parent 887c8d2 commit 11f78ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 0 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import resolve from '@rollup/plugin-node-resolve';
import commonjs from "@rollup/plugin-commonjs";

export default [
{
input: "./src/index.js",
Expand All @@ -9,9 +6,5 @@ export default [
{ file: "dist/index.esm.mjs", format: "es" },
{ file: "dist/index.umd.js", format: "umd", name: "unitFlip" },
],
plugins:[
resolve(),
commonjs(),
]
},
];
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ const conversion = {
* @throws {Error} If the target or source unit does not exist in the conversion unit.
*/

module.exports = (
const unitFlip = (
value,
sourceUnit,
targetUnit,
Expand Down Expand Up @@ -450,3 +450,5 @@ module.exports = (

return converted;
};

export default unitFlip;

0 comments on commit 11f78ff

Please sign in to comment.