[fix] stale vscode (#275)

* modify scripts

* Update build.js

* fix scripts
This commit is contained in:
Steve Ruiz 2021-11-13 11:02:10 +00:00 committed by GitHub
parent 22f2c2f6c6
commit 252efee211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 10 deletions

View file

View file

@ -15,7 +15,7 @@ async function main() {
esbuild.buildSync({
entryPoints: ['./src/extension.ts'],
outdir: 'dist/web',
minify: true,
minify: false,
bundle: true,
format: 'cjs',
target: 'es6',
@ -24,7 +24,6 @@ async function main() {
},
tsconfig: './tsconfig.json',
external: ['vscode'],
metafile: true,
})
console.log(`Built package.`)
} catch (e) {

View file

@ -12,7 +12,7 @@ async function main() {
}
try {
esbuild.buildSync({
await esbuild.build({
entryPoints: ['./src/extension.ts'],
outdir: 'dist/web',
minify: false,
@ -25,6 +25,12 @@ async function main() {
},
tsconfig: './tsconfig.json',
external: ['vscode'],
incremental: true,
watch: {
onRebuild(err) {
err ? console.error('❌ Failed') : console.log('✅ Updated')
},
},
})
console.log(`Built package.`)

View file

@ -1,24 +1,30 @@
/* eslint-disable */
//const version = require('../../../lerna.json').version
const fs = require('fs')
const pkg = require('../package.json')
const { exec } = require('child_process')
const fs = require('fs')
const dir = './temp'
async function main() {
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true }, (e) => {
if (fs.existsSync('./editor')) {
fs.rmSync('./editor', { recursive: true }, (e) => {
if (e) {
throw e
}
})
}
if (fs.existsSync('./temp')) {
fs.rmSync('./temp', { recursive: true }, (e) => {
if (e) {
throw e
}
})
}
fs.mkdirSync(dir)
fs.mkdirSync('./temp')
try {
exec(
`cp -r ../editor/dist editor; vsce package; mv ${pkg.name}-${pkg.version}.vsix ${dir}`,
`cp -r ../editor/dist editor; vsce package; mv ${pkg.name}-${pkg.version}.vsix ${'./temp'}`,
(error, stdout, stderr) => {
if (error) {
throw new Error(error.message)