Don't import package.json in scripts/refresh-assets.ts, just read it (#3116)
Per #3018, the `import` causes `scripts/refresh-assets.ts` to fail on Windows. This PR applies @SomeHats's suggestions cleanly on top of the current `main`. Thank you @cscxj for the original report! Describe what your pull request does. If appropriate, add GIFs or images showing the before and after. ### Change Type - [x] `internal` — Any other changes that don't affect the published package
This commit is contained in:
parent
19a1d01b8e
commit
f1b4f807d8
1 changed files with 3 additions and 3 deletions
|
@ -402,9 +402,9 @@ async function writeAssetDeclarationDTSFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function copyVersionToDotCom() {
|
async function copyVersionToDotCom() {
|
||||||
const packageVersion = await import(join(REPO_ROOT, 'packages', 'tldraw', 'package.json')).then(
|
const packageJson = await readJsonIfExists(join(REPO_ROOT, 'packages', 'tldraw', 'package.json'))
|
||||||
(pkg) => pkg.version
|
const packageVersion = packageJson.version
|
||||||
)
|
|
||||||
const file = `export const version = '${packageVersion}'`
|
const file = `export const version = '${packageVersion}'`
|
||||||
await writeCodeFile(
|
await writeCodeFile(
|
||||||
'scripts/refresh-assets.ts',
|
'scripts/refresh-assets.ts',
|
||||||
|
|
Loading…
Reference in a new issue