Skip to content

Commit ae93976

Browse files
committed
add tsconfig and package.json script for creating types files
1 parent 5fa71bb commit ae93976

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/gatsby/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434
"react": "^18.0.0"
3535
},
3636
"scripts": {
37-
"build": "run-p build:cjs build:esm build:types",
37+
"build": "run-p build:cjs build:esm build:types build:plugin",
3838
"build:cjs": "tsc -p tsconfig.cjs.json",
3939
"build:dev": "run-s build",
4040
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
4141
"build:esm": "tsc -p tsconfig.esm.json",
42+
"build:plugin": "tsc -p tsconfig.plugin.json",
4243
"build:types": "tsc -p tsconfig.types.json",
4344
"build:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
4445
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",

packages/gatsby/tsconfig.plugin.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["gatsby-browser.js", "gatsby-node.js"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
// "types": ["node", "jest"]
9+
"declaration": true,
10+
"declarationMap": false,
11+
"emitDeclarationOnly": true,
12+
"allowJs": true,
13+
"skipLibCheck": true
14+
15+
// other package-specific, plugin-specific options
16+
}
17+
}

0 commit comments

Comments
 (0)