Skip to content

Commit 44add65

Browse files
committed
feat(lib): add basic lib functionality
1 parent 05e625a commit 44add65

File tree

7 files changed

+397
-10
lines changed

7 files changed

+397
-10
lines changed

index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

package-lock.json

Lines changed: 66 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@
22
"name": "eval-num-expr",
33
"version": "0.0.3",
44
"description": "Evaluate numerical expressions",
5-
"main": "index.js",
5+
"main": "dist/index.js",
6+
"module": "dist/index.es.js",
7+
"browser": "dist/index.umd.js",
8+
"types": "types/index.d.ts",
69
"scripts": {
10+
"build": "rollup -c",
711
"release": "np --no-2fa"
812
},
913
"keywords": [],
1014
"files": [
11-
"index.js"
15+
"dist"
1216
],
1317
"author": "Sudhir M <https://github.com/sudkumar>",
14-
"license": "ISC",
18+
"license": "MIT",
19+
"repository": {
20+
"type": "git",
21+
"url": "git+https://github.com/craftsys/eval-num-expr.git"
22+
},
1523
"devDependencies": {
24+
"@rollup/plugin-typescript": "^8.2.1",
1625
"np": "^7.4.0",
17-
"prettier": "^2.2.1"
26+
"prettier": "^2.2.1",
27+
"rollup": "^2.45.2",
28+
"tslib": "^2.2.0",
29+
"typescript": "^4.2.4"
1830
}
1931
}

rollup.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pkg from "./package.json";
2+
import typescript from "@rollup/plugin-typescript";
3+
4+
export default [
5+
// UMD
6+
{
7+
input: "src/index.ts",
8+
output: {
9+
name: "evalNumExpr",
10+
file: pkg.browser,
11+
format: "umd",
12+
},
13+
plugins: [typescript({ sourceMap: false })],
14+
},
15+
16+
// CommonJS (for Node) and ES module (for bundlers) build.
17+
{
18+
input: "src/index.ts",
19+
output: [
20+
{ file: pkg.main, format: "cjs", exports: "auto" },
21+
{ file: pkg.module, format: "es" },
22+
],
23+
plugins: [typescript({ sourceMap: false })],
24+
},
25+
];

0 commit comments

Comments
 (0)