Skip to content

Commit

Permalink
feat: add ESM support
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Aug 17, 2022
1 parent 3402e36 commit 8483860
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 2 deletions.
111 changes: 111 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "fm-data-api-client",
"version": "1.2.2",
"description": "FileMaker Data API Client",
"main": "dist/index.js",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"build": "rm -rf dist && rollup -c",
"lint": "eslint .",
"test": "jest test --coverage",
"prepare": "husky install"
Expand All @@ -30,6 +31,7 @@
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@js-joda/core": "^5.2.0",
"@rollup/plugin-typescript": "^8.3.4",
"@tsconfig/node14": "^1.0.1",
"@types/form-data": "^2.5.0",
"@types/into-stream": "^3.1.1",
Expand All @@ -44,6 +46,7 @@
"jest": "^27.5.1",
"lint-staged": "^12.3.8",
"nock": "^13.2.4",
"rollup": "^2.78.0",
"sinon": "^13.0.2",
"ts-jest": "^27.1.4",
"typescript": "^4.0.3"
Expand Down
15 changes: 15 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import typescript from '@rollup/plugin-typescript';
import pkg from './package.json';

export default [
{
input: 'src/index.ts',
output: [
{file: pkg.main, format: 'cjs', sourcemap: true},
{file: pkg.module, format: 'es', sourcemap: true},
],
plugins: [
typescript({tsconfig: './tsconfig.json'}),
],
},
];

0 comments on commit 8483860

Please sign in to comment.