Files
logseq/tldraw/packages/react/scripts/dev.js
2022-05-16 19:55:07 +08:00

34 lines
769 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* eslint-disable */
const esbuild = require('esbuild')
const pkg = require('../package.json')
const { log } = console
async function main() {
esbuild.build({
entryPoints: ['./src/index.ts'],
outdir: 'dist/esm',
minify: false,
bundle: true,
format: 'esm',
target: 'es6',
tsconfig: './tsconfig.build.json',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
external: Object.keys(pkg.dependencies).concat(Object.keys(pkg.peerDependencies)),
incremental: true,
sourcemap: true,
watch: {
onRebuild(error) {
if (error) {
log(`× ${pkg.name}: An error in prevented the rebuild.`)
return
}
log(`${pkg.name}: Rebuilt.`)
},
},
})
}
main()