Skip to content

Commit

Permalink
Separate default tsconfigs from build
Browse files Browse the repository at this point in the history
Creates new `tsconfig.cjs.json` files in each package that are used to
compile the code. The default `tsconfig.json` in each package is now
meant as a development config, and its `rootDir` change will allow us to
change our tests from JS to TS.
  • Loading branch information
sgray committed May 21, 2020
1 parent 4f4ea97 commit de2fd69
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 20 deletions.
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:umd",
"build:watch": "concurrently 'yarn build:cjs:watch' 'yarn build:esm:watch'",
"build:cjs": "tsc -p tsconfig.json",
"build:cjs:watch": "tsc -p tsconfig.json -w --preserveWatchOutput",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
"build:esm": "tsc -p tsconfig.esm.json",
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"build:umd": "rollup --config",
Expand Down
7 changes: 7 additions & 0 deletions packages/browser/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
6 changes: 3 additions & 3 deletions packages/browser/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"module": "ES6",
"outDir": "esm"
}
},
"include": ["src"]
}
8 changes: 4 additions & 4 deletions packages/browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.cjs.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
}
"rootDir": ".",
},
"include": ["src", "test"]
}
4 changes: 2 additions & 2 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"scripts": {
"build": "yarn build:cjs && yarn build:esm",
"build:watch": "concurrently 'yarn build:cjs:watch' 'yarn build:esm:watch'",
"build:cjs": "tsc -p tsconfig.json",
"build:cjs:watch": "tsc -p tsconfig.json -w --preserveWatchOutput",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:cjs:watch": "tsc -p tsconfig.cjs.json -w --preserveWatchOutput",
"build:esm": "tsc -p tsconfig.esm.json",
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
"clean": "rm -rf dist esm",
Expand Down
7 changes: 7 additions & 0 deletions packages/node/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
6 changes: 3 additions & 3 deletions packages/node/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.esm.json",
"compilerOptions": {
"module": "ES6",
"outDir": "esm"
}
},
"include": ["src"]
}
8 changes: 4 additions & 4 deletions packages/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"extends": "./tsconfig.cjs.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
}
"rootDir": ".",
},
"include": ["src", "test"]
}
6 changes: 6 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ES6"
}
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"preserveConstEnums": true,
"skipLibCheck": true,
"sourceMap": true,
"target": "ES5",
"types": ["node", "jest"]
"target": "ES5"
}
}

0 comments on commit de2fd69

Please sign in to comment.