Skip to content

Commit 9a83b73

Browse files
committed
feat: add esmodule version of pagino
1 parent f0b7ad1 commit 9a83b73

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ lib
22

33
node_modules
44

5+
index.cjs
6+
57
index.js

package.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22
"name": "pagino",
33
"version": "1.0.0",
44
"description": "This project aims to handle pagination core object in Javascript independent of UI",
5-
"main": "index.js",
5+
"main": "index.cjs",
6+
"type": "module",
7+
"module": "index.js",
8+
"exports": {
9+
"./package.json": "./package.json",
10+
".": {
11+
"require": "./index.cjs",
12+
"import": "./index.js"
13+
}
14+
},
15+
"types": "index.d.ts",
616
"scripts": {
7-
"build": "tsc",
17+
"build-commonjs": "tsc --target ES5 && mv ./index.js ./index.cjs",
18+
"build-esmodule": "tsc --target ES2020",
19+
"build": "build-commonjs && build-esmodule",
820
"test": "jest",
921
"minify": "minify ./index.js --out-file ./index.js --mangle.keepClassName",
1022
"format": "prettier ./src --write --ignore-unknown",

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"exclude": ["node_modules", "src/**/*.test.ts"],
33
"compilerOptions": {
4-
"target": "ES5",
54
"moduleResolution": "Node",
65
"removeComments": true,
76
"baseUrl": "./src",
8-
"outDir": "./",
7+
"outDir": "./"
98
}
109
}

0 commit comments

Comments
 (0)