Build scripts and updated

This commit is contained in:
Nik
2022-12-02 07:21:21 +11:00
parent 8a05e9d09c
commit e52826cd03
3 changed files with 34 additions and 3 deletions

18
scripts/post-build.js Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env node
import { readFileSync, writeFileSync } from 'fs'
//Put the exports field back into package.json so that monorepos can work again
let packageJson = readFileSync('package.json').toString()
packageJson = packageJson.slice(0, packageJson.lastIndexOf('}')-1) //strip closing }
packageJson +=
`,
"exports": {
".": "./src/lib/index.ts",
"./themes/*": "./src/lib/themes/*",
"./styles/*": "./src/lib/styles/*",
"./tailwind/*": "./src/lib/tailwind/*"
}
}`
writeFileSync('package.json', packageJson);