diff --git a/other/patch-preact-package-json.js b/other/patch-preact-package-json.js new file mode 100644 index 00000000..6b07058c --- /dev/null +++ b/other/patch-preact-package-json.js @@ -0,0 +1,9 @@ +const fs = require('fs') +const path = require('path') + +const packageJsonPath = path.resolve(__dirname, '..', 'preact', 'package.json') + +const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) +packageJson.typings = '../typings/preact/glamorous.d.ts' + +fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`) diff --git a/package.json b/package.json index 7f9c89d9..a7d026e9 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build:main": "kcd-scripts build --bundle --p-react --no-clean", "build:tiny": "npm run build:main -- --no-package-json --environment BUILD_TINY", + "postbuild": "node other/patch-preact-package-json.js", "lint": "kcd-scripts lint", "test": "kcd-scripts test", "test:cover": "kcd-scripts test --coverage",