diff --git a/.eslintignore b/.eslintignore index 65a5473..684767e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ dist prettier.config.js karma.config.js +dist-cjs diff --git a/.gitignore b/.gitignore index 1eae0cf..45806da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist/ +dist-cjs/ node_modules/ diff --git a/package.json b/package.json index cd66e61..6119be9 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,15 @@ "name": "@github/combobox-nav", "description": "Attach combobox navigation behavior to an input.", "version": "2.1.5", - "main": "dist/index.js", + "main": "dist-cjs/index.js", "module": "dist/index.js", - "type": "module", + "exports": { + ".": { + "node": "./dist-cjs/index.js", + "require": "./dist-cjs/index.js", + "default": "./dist/index.js" + } + }, "types": "dist/index.d.ts", "license": "MIT", "repository": "github/combobox-nav", @@ -16,7 +22,7 @@ "clean": "rm -rf dist", "lint": "eslint .", "prebuild": "npm run clean && npm run lint && mkdir dist", - "build": "tsc", + "build": "tsc && tsc --module commonjs --outDir dist-cjs", "test": "karma start karma.config.cjs", "pretest": "npm run build", "prepublishOnly": "npm run build",