[fix] stale vscode (#275)
* modify scripts * Update build.js * fix scripts
This commit is contained in:
parent
22f2c2f6c6
commit
252efee211
5 changed files with 21 additions and 10 deletions
0
vscode/extension/.vscodeignore
Normal file
0
vscode/extension/.vscodeignore
Normal 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) {
|
||||
|
|
|
@ -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.`)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue