tldraw/apps/vscode/editor/scripts/build.mjs
Steve Ruiz 7c2777966f
[improvement] Multiplayer + cursors (#457)
* bump versions, improve cursors

* Spline cursors
2021-12-22 00:14:38 +00:00

42 lines
898 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 */
import fs from 'fs'
import esbuild from 'esbuild'
import { createRequire } from 'module'
const pkg = createRequire(import.meta.url)('../package.json')
const { log: jslog } = console
async function main() {
if (fs.existsSync('./dist')) {
fs.rmSync('./dist', { recursive: true }, (e) => {
if (e) {
throw e
}
})
}
try {
esbuild.buildSync({
entryPoints: ['./src/index.tsx'],
outfile: 'dist/index.js',
minify: false,
bundle: true,
format: 'esm',
target: 'es6',
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment',
tsconfig: './tsconfig.json',
define: {
'process.env.NODE_ENV': '"production"',
},
})
jslog(`${pkg.name}: Build completed.`)
} catch (e) {
jslog(`× ${pkg.name}: Build failed due to an error.`)
jslog(e)
}
}
main()