590562b5ba
* Removes references to webpack scripts from .vscode settings * clean up scripts, remove references to webpack * works! * Delete getHtmlForWebview.ts * Update scripts * Update package.json * Remove more config * Enable debugger into ts files * Fixes fails on New TLDraw Document Co-authored-by: Proful <proful.sadangi@gmail.com>
37 lines
735 B
JavaScript
37 lines
735 B
JavaScript
/* 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',
|
||
sourcemap: 'inline',
|
||
define: {
|
||
'process.env.NODE_ENV': '"development"',
|
||
},
|
||
tsconfig: './tsconfig.json',
|
||
external: ['vscode'],
|
||
})
|
||
|
||
console.log(`Built package.`)
|
||
} catch (e) {
|
||
console.log(`× Build failed due to an error.`)
|
||
console.log(e)
|
||
}
|
||
}
|
||
|
||
main()
|