diff options
| author | Dax Raad <[email protected]> | 2025-09-09 23:43:37 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-09-09 23:44:04 -0400 |
| commit | 38e8c42cf02f73fb300889ab989088899a3aedb7 (patch) | |
| tree | 313db96535cf136cc1032618b43462c1f2f0e14c /sdks/vscode/esbuild.js | |
| parent | 58fe88432714456350244ebbea1e6287d3dccb36 (diff) | |
| download | opencode-38e8c42cf02f73fb300889ab989088899a3aedb7.tar.gz opencode-38e8c42cf02f73fb300889ab989088899a3aedb7.zip | |
ci: format
Diffstat (limited to 'sdks/vscode/esbuild.js')
| -rw-r--r-- | sdks/vscode/esbuild.js | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/sdks/vscode/esbuild.js b/sdks/vscode/esbuild.js index cc2be598a..aa09b4eba 100644 --- a/sdks/vscode/esbuild.js +++ b/sdks/vscode/esbuild.js @@ -1,56 +1,54 @@ -const esbuild = require("esbuild"); +const esbuild = require("esbuild") -const production = process.argv.includes('--production'); -const watch = process.argv.includes('--watch'); +const production = process.argv.includes("--production") +const watch = process.argv.includes("--watch") /** * @type {import('esbuild').Plugin} */ const esbuildProblemMatcherPlugin = { - name: 'esbuild-problem-matcher', + name: "esbuild-problem-matcher", - setup(build) { - build.onStart(() => { - console.log('[watch] build started'); - }); - build.onEnd((result) => { - result.errors.forEach(({ text, location }) => { - console.error(`✘ [ERROR] ${text}`); - console.error(` ${location.file}:${location.line}:${location.column}:`); - }); - console.log('[watch] build finished'); - }); - }, -}; + setup(build) { + build.onStart(() => { + console.log("[watch] build started") + }) + build.onEnd((result) => { + result.errors.forEach(({ text, location }) => { + console.error(`✘ [ERROR] ${text}`) + console.error(` ${location.file}:${location.line}:${location.column}:`) + }) + console.log("[watch] build finished") + }) + }, +} async function main() { - const ctx = await esbuild.context({ - entryPoints: [ - 'src/extension.ts' - ], - bundle: true, - format: 'cjs', - minify: production, - sourcemap: !production, - sourcesContent: false, - platform: 'node', - outfile: 'dist/extension.js', - external: ['vscode'], - logLevel: 'silent', - plugins: [ - /* add to the end of plugins array */ - esbuildProblemMatcherPlugin, - ], - }); - if (watch) { - await ctx.watch(); - } else { - await ctx.rebuild(); - await ctx.dispose(); - } + const ctx = await esbuild.context({ + entryPoints: ["src/extension.ts"], + bundle: true, + format: "cjs", + minify: production, + sourcemap: !production, + sourcesContent: false, + platform: "node", + outfile: "dist/extension.js", + external: ["vscode"], + logLevel: "silent", + plugins: [ + /* add to the end of plugins array */ + esbuildProblemMatcherPlugin, + ], + }) + if (watch) { + await ctx.watch() + } else { + await ctx.rebuild() + await ctx.dispose() + } } -main().catch(e => { - console.error(e); - process.exit(1); -}); +main().catch((e) => { + console.error(e) + process.exit(1) +}) |
