diff --git a/build.js b/build.js deleted file mode 100644 index 426c71cb..00000000 --- a/build.js +++ /dev/null @@ -1,24 +0,0 @@ -;(async () => { - const child = require('child_process') - const {build} = require('esbuild') - - await build({ - outfile: 'dist/index.mjs', - format: 'esm', - target: 'es6', - bundle: true, - external: ['@testing-library/dom'], - entryPoints: ['src/index.ts'], - }) - - await build({ - outfile: 'dist/index.cjs', - format: 'cjs', - target: 'node12', - bundle: true, - external: ['@testing-library/dom'], - entryPoints: ['src/index.ts'], - }) - - child.execSync('yarn tsc -p tsconfig.build.json') -})() diff --git a/package.json b/package.json index 8631c5cf..05e7d110 100644 --- a/package.json +++ b/package.json @@ -25,17 +25,8 @@ "files": [ "dist" ], - "main": "./dist/index.cjs", - "module": "./dist/index.mjs", - "exports": { - ".": { - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" - } - }, - "types": "./dist/types/index.d.ts", "scripts": { - "build": "node build.js", + "build": "scripts ts-build2 --cjs", "lint": "kcd-scripts lint", "setup": "npm install && npm run validate -s", "test": "kcd-scripts test", @@ -45,12 +36,12 @@ "typecheck": "kcd-scripts typecheck" }, "devDependencies": { + "@ph.fritsche/scripts-config": "^2.2.4", "@testing-library/dom": "^8.11.4", "@testing-library/jest-dom": "^5.16.3", "@testing-library/react": "^13.0.0", "@types/jest-in-case": "^1.0.3", "@types/react": "^17.0.42", - "esbuild": "^0.14.27", "eslint-import-resolver-typescript": "^2.7.0", "eslint-plugin-local-rules": "^1.1.0", "is-ci": "^3.0.1", @@ -63,6 +54,7 @@ "reactDom17": "npm:react-dom@^17.0.2", "reactIs17": "npm:react-is@^17.0.2", "reactTesting17": "npm:@testing-library/react@^12.1.3", + "shared-scripts": "^1.5.1", "typescript": "^4.1.2" }, "peerDependencies": { diff --git a/scripts.config.js b/scripts.config.js new file mode 100644 index 00000000..97fe746d --- /dev/null +++ b/scripts.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@ph.fritsche/scripts-config'], +}