You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dev.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* eslint-disable */
  2. const esbuild = require('esbuild')
  3. const name = process.env.npm_package_name || ''
  4. async function main() {
  5. esbuild.build({
  6. entryPoints: ['./src/index.ts'],
  7. outdir: 'dist/esm',
  8. minify: false,
  9. bundle: true,
  10. format: 'esm',
  11. target: 'es6',
  12. jsxFactory: 'React.createElement',
  13. jsxFragment: 'React.Fragment',
  14. tsconfig: './tsconfig.build.json',
  15. external: [
  16. 'react',
  17. 'react-dom',
  18. '@stitches/react',
  19. '@radix-ui/react-alert-dialog',
  20. '@radix-ui/react-checkbox',
  21. '@radix-ui/react-context-menu',
  22. '@radix-ui/react-dropdown-menu',
  23. '@radix-ui/react-icons',
  24. '@radix-ui/react-id',
  25. '@radix-ui/react-radio',
  26. '@radix-ui/react-tooltip',
  27. '@tldraw/core',
  28. '@tldraw/vec',
  29. '@tldraw/intersect',
  30. 'perfect-freehand',
  31. 'rko',
  32. 'react-hotkeys-hook',
  33. ],
  34. sourcemap: true,
  35. incremental: true,
  36. watch: {
  37. onRebuild(error) {
  38. if (error) {
  39. console.log(`× ${name}: An error in prevented the rebuild.`)
  40. return
  41. }
  42. console.log(`✔ ${name}: Rebuilt.`)
  43. },
  44. },
  45. })
  46. }
  47. main()