Skip to content

Commit

Permalink
✨ Export non currying version
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Jun 29, 2021
1 parent d9a11e7 commit 0966977
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,20 @@
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/index.es.d.ts",
"typesVersions": {
"*": {
"./": ["dist/index.es.d.ts"],
"non-curry": ["dist/non-curry/index.es.d.ts"]
}
},
"exports": {
".": {
"require": "./dist/index.cjs.js",
"import": "./dist/index.es.js"
},
"./non-curry": {
"require": "./dist/non-curry/index.cjs.js",
"import": "./dist/non-curry/index.es.js"
}
},
"sideEffects": false,
Expand Down
44 changes: 44 additions & 0 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { dependencies, main, module } from "./package.json";

const baseDir = resolve(__dirname);
const inputFilePath = resolve(baseDir, "mod.ts");
const nonCurryInputFilePath = resolve(baseDir, "non_curry", "mod.ts");
const banner =
"/*! Copyright (c) 2021-present the Core-fn authors. All rights reserved. MIT license. */";
const external = Object.keys(dependencies);
Expand Down Expand Up @@ -59,6 +60,49 @@ const config = [
banner,
},
},

{
input: nonCurryInputFilePath,
plugins: [
replace(replaceOption),
ts({
transpiler: "babel",
tsconfig: (resolvedConfig) => ({
...resolvedConfig,
declaration: false,
}),
}),
terser(),
],

external,

output: {
file: "dist/non-curry/index.cjs.js",
format: "cjs",
sourcemap: true,
banner,
},
},
{
input: nonCurryInputFilePath,
plugins: [
replace(replaceOption),
ts({
transpiler: "babel",
}),
terser(),
],

external,

output: {
file: "dist/non-curry/index.es.js",
format: "es",
sourcemap: true,
banner,
},
},
];

export default config;

0 comments on commit 0966977

Please sign in to comment.