Tldraw/packages/tldraw/scripts/dev.js

34 wiersze
780 B
JavaScript
Czysty Wina Historia

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* eslint-disable */
const esbuild = require('esbuild')
const pkg = require('../package.json')
const { log: jslog } = console
async function main() {
esbuild.build({
entryPoints: ['./src/index.ts'],
outdir: 'dist/esm',
minify: false,
bundle: true,
format: 'esm',
target: 'es6',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
tsconfig: './tsconfig.build.json',
external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)),
sourcemap: true,
incremental: true,
watch: {
onRebuild(error) {
if (error) {
jslog(`× ${pkg.name}: An error in prevented the rebuild.`)
return
}
jslog(`${pkg.name}: Rebuilt.`)
},
},
})
}
main()