diff --git a/.gitignore b/.gitignore index 7fcaa2c..bd43575 100644 --- a/.gitignore +++ b/.gitignore @@ -191,4 +191,5 @@ Temporary Items ### Project public -dist +/dist +/esm diff --git a/package.json b/package.json index 903f93e..0ba3d10 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "@cromefire_/nativeshell-api-definition", "version": "1.0.0", - "module": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/index.js", + "module": "esm/index.js", + "types": "esm/index.d.ts", "license": "Apache-2.0", "scripts": { - "build": "tsc -b tsconfig.json", + "build": "tsc -b tsconfig.json tsconfig.commonjs.json", "lint": "eslint src/**", "docs": "typedoc" }, diff --git a/tsconfig.commonjs.json b/tsconfig.commonjs.json new file mode 100644 index 0000000..c681758 --- /dev/null +++ b/tsconfig.commonjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "module": "CommonJS" + } +} diff --git a/tsconfig.json b/tsconfig.json index 408ef2a..60dd3ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "baseUrl": "src", "rootDir": "src", - "outDir": "dist", + "outDir": "esm", "moduleResolution": "Node", "module": "esnext", "target": "ESNext",