tldraw/vscode/extension/scripts/build.js
Steve Ruiz 252efee211
[fix] stale vscode (#275)
* modify scripts

* Update build.js

* fix scripts
2021-11-13 11:02:10 +00:00

35 lines
706 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 fs = require('fs')
const esbuild = require('esbuild')
async function main() {
if (fs.existsSync('./dist')) {
fs.rmSync('./dist', { recursive: true }, (e) => {
if (e) {
throw e
}
})
}
try {
esbuild.buildSync({
entryPoints: ['./src/extension.ts'],
outdir: 'dist/web',
minify: false,
bundle: true,
format: 'cjs',
target: 'es6',
define: {
'process.env.NODE_ENV': '"production"',
},
tsconfig: './tsconfig.json',
external: ['vscode'],
})
console.log(`Built package.`)
} catch (e) {
console.log(`× Build failed due to an error.`)
console.log(e)
}
}
main()