From 34144b4b07dd1666b3b7acc33a23f6b38da75c47 Mon Sep 17 00:00:00 2001 From: Randolf J Date: Fri, 10 Jun 2022 17:02:19 +0200 Subject: [PATCH] chore: update CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- compat/cjs/tsconfig.json | 8 +------- compat/esm/tsconfig.json | 8 +------- tsconfig.json | 3 --- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2822b2ed928..9e47882425c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,10 +86,10 @@ To run ESLint, use: npm run lint:eslint ``` -You can check your code (both JS & TS) type-checks by running: +You can check your code by running: ```bash -npm run build:tsc +npm run build ``` ## TypeScript guidelines @@ -107,7 +107,7 @@ We structure these using TypeScript's project references, which lets us treat ea ### Shipping CJS and ESM bundles -Currently Puppeteer ships two bundles; a CommonJS version for Node and an ESM bundle for the browser. Therefore we maintain two `tsconfig` files for each project; `tsconfig.esm.json` and `tsconfig.cjs.json`. At build time we compile twice, once outputting to CJS and another time to output to ESM. +Currently Puppeteer ships both CommonJS and ESM, therefore we maintain two `tsconfig` files for each project: `tsconfig.esm.json` and `tsconfig.cjs.json`. At build time we compile twice, once outputting to CJS and another time to output to ESM. We compile into the `lib` directory which is what we publish on the npm repository and it's structured like so: diff --git a/compat/cjs/tsconfig.json b/compat/cjs/tsconfig.json index 2bcb2b984b4..b9ad322fb85 100644 --- a/compat/cjs/tsconfig.json +++ b/compat/cjs/tsconfig.json @@ -1,9 +1,3 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "../../lib/cjs/puppeteer", - "module": "CommonJS" - }, - "references": [{ "path": "../../vendor/tsconfig.cjs.json" }] + "extends": "../../src/tsconfig.cjs.json" } diff --git a/compat/esm/tsconfig.json b/compat/esm/tsconfig.json index 42b320fcd3f..94d6b560e5d 100644 --- a/compat/esm/tsconfig.json +++ b/compat/esm/tsconfig.json @@ -1,9 +1,3 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "../../lib/esm/puppeteer", - "module": "esnext" - }, - "references": [{ "path": "../../vendor/tsconfig.esm.json" }] + "extends": "../../src/tsconfig.esm.json" } diff --git a/tsconfig.json b/tsconfig.json index 0fe7e06ad83..2e154c1f46b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,9 +7,6 @@ "extends": "./tsconfig.base.json", "compilerOptions": { "noEmit": true, - /* This module setting is just for VSCode so it doesn't throw error when we - use dynamic imports. - */ "module": "esnext" }, "include": ["src"]