feat: add universal logger instead of console.log.

- fixed esbuild issues
- converted to npm instead of pnpm since root project is npm (might switch whole project to pnpm later)
This commit is contained in:
Ralph Khreish
2025-07-28 17:03:35 +03:00
parent 662a4eaecb
commit 722b6c5836
20 changed files with 8232 additions and 6766 deletions

View File

@@ -69,8 +69,8 @@ async function main() {
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
sourcemap: !production ? 'inline' : false,
sourcesContent: !production,
platform: 'node',
outdir: 'dist',
external: ['vscode'],
@@ -90,8 +90,8 @@ async function main() {
format: 'iife',
globalName: 'App',
minify: production,
sourcemap: !production,
sourcesContent: false,
sourcemap: !production ? 'inline' : false,
sourcesContent: !production,
platform: 'browser',
outdir: 'dist',
logLevel: 'silent',
@@ -99,6 +99,13 @@ async function main() {
jsx: 'automatic',
jsxImportSource: 'react',
external: ['*.css'],
// Bundle React with webview since it's not available in the runtime
// This prevents the multiple React instances issue
// Ensure React is resolved from the workspace root to avoid duplicates
alias: {
react: path.resolve(__dirname, '../../node_modules/react'),
'react-dom': path.resolve(__dirname, '../../node_modules/react-dom')
},
define: {
'process.env.NODE_ENV': production ? '"production"' : '"development"',
global: 'globalThis'