Skip to content

Commit

Permalink
Merge pull request #9 from github/add-cjs-exports
Browse files Browse the repository at this point in the history
Add cjs exports
  • Loading branch information
dgreif authored May 2, 2022
2 parents a34dcef + f5a621b commit c01d542
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
7 changes: 7 additions & 0 deletions decorator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@github/memoize/decorator",
"types": "../dist/esm/decorator.d.ts",
"main": "../dist/cjs/decorator.js",
"module": "../dist/esm/decorator.js",
"sideEffects": false
}
27 changes: 20 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,32 @@
"license": "MIT",
"author": "GitHub Inc. (https://github.com)",
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
".": "./dist/index.js",
"./decorator": "./dist/decorator.js"
".": {
"module": "./dist/esm/index.js",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts"
},
"./decorator": {
"module": "./dist/esm/decorator.js",
"import": "./dist/esm/decorator.js",
"require": "./dist/cjs/decorator.js",
"types": "./dist/esm/decorator.d.ts"
}
},
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"types": "./dist/esm/index.d.ts",
"files": [
"dist"
"dist",
"decorator"
],
"scripts": {
"prebuild": "npm run clean && npm run lint && mkdir dist",
"build": "tsc",
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"clean": "rm -rf dist",
"lint": "eslint --report-unused-disable-directives . --color --ext .js,.ts,.tsx && tsc --noEmit",
"prepublishOnly": "npm run build",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"outDir": "dist",
"outDir": "dist/esm",
"experimentalDecorators": true
},
"exclude": ["test", "dist"]
Expand Down

0 comments on commit c01d542

Please sign in to comment.