e6a3e5c3ea
* move core into repo, apps into apps folder, update tests * Update scripts for build:core * improve scripts * remove noise from www * Update .gitignore * Fix focus bug * add ci test script * Update main.yml
35 lines
706 B
JavaScript
35 lines
706 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',
|
||
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()
|