build.mjs 506 B

12345678910111213141516171819
  1. #!/usr/bin/env zx
  2. /* eslint-disable no-undef */
  3. import 'zx/globals'
  4. import fs from 'fs'
  5. // Build with [tsup](https://tsup.egoist.sh)
  6. await $`tsup`
  7. // Prepare package.json file
  8. const packageJson = fs.readFileSync('package.json', 'utf8')
  9. const glob = JSON.parse(packageJson)
  10. Object.assign(glob, {
  11. main: './index.js',
  12. module: './index.mjs',
  13. })
  14. fs.writeFileSync('dist/package.json', JSON.stringify(glob, null, 2))
  15. await $`ln -f ${__dirname}/dist/index.js ${__dirname}/../../../src/js/tldraw-logseq.js`