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.

pre-dev.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* eslint-disable */
  2. const fs = require('fs')
  3. const esbuild = require('esbuild')
  4. async function main() {
  5. if (fs.existsSync('./dist')) {
  6. fs.rmSync('./dist', { recursive: true }, (e) => {
  7. if (e) {
  8. throw e
  9. }
  10. })
  11. }
  12. esbuild.build({
  13. entryPoints: ['./src/index.ts'],
  14. outdir: 'dist/esm',
  15. minify: false,
  16. bundle: true,
  17. format: 'esm',
  18. target: 'es6',
  19. jsxFactory: 'React.createElement',
  20. jsxFragment: 'React.Fragment',
  21. tsconfig: './tsconfig.build.json',
  22. external: [
  23. 'react',
  24. 'react-dom',
  25. 'tslib',
  26. '@stitches/react',
  27. '@radix-ui/react-alert-dialog',
  28. '@radix-ui/react-checkbox',
  29. '@radix-ui/react-context-menu',
  30. '@radix-ui/react-dropdown-menu',
  31. '@radix-ui/react-icons',
  32. '@radix-ui/react-id',
  33. '@radix-ui/react-radio',
  34. '@radix-ui/react-tooltip',
  35. '@tldraw/core',
  36. '@tldraw/vec',
  37. '@tldraw/intersect',
  38. 'perfect-freehand',
  39. 'rko',
  40. 'react-hotkeys-hook',
  41. ],
  42. })
  43. }
  44. main()