diff --git a/lana/package.json b/lana/package.json index a2e86a9a..64e04827 100644 --- a/lana/package.json +++ b/lana/package.json @@ -29,8 +29,8 @@ "profiling", "soql" ], - "type": "module", "main": "out/Main.js", + "browser": "out/web/Main.web.js", "icon": "./certinia-icon-color.png", "galleryBanner": { "color": "#000000", @@ -52,9 +52,16 @@ "categories": [ "Other" ], + "capabilities": { + "virtualWorkspaces": true, + "untrustedWorkspaces": { + "supported": true + } + }, "activationEvents": [ "onLanguage:apexlog", - "onStartupFinished" + "onStartupFinished", + "onFileSystem:memfs" ], "contributes": { "commands": [ @@ -378,7 +385,8 @@ ] }, "scripts": { - "vscode:prepublish": "pnpm -w run build && pnpm -w run copy:package-docs" + "vscode:prepublish": "pnpm -w run build && pnpm -w run copy:package-docs", + "vscode:bundle": "pnpm -w run build" }, "dependencies": { "@apexdevtools/apex-parser": "5.1.0", diff --git a/lana/src/Main.web.ts b/lana/src/Main.web.ts new file mode 100644 index 00000000..effc1281 --- /dev/null +++ b/lana/src/Main.web.ts @@ -0,0 +1,5 @@ +/* + * Copyright (c) 2026 Certinia Inc. All rights reserved. + */ + +export { activate, context, deactivate } from './Main.js'; diff --git a/rolldown.config.ts b/rolldown.config.ts index 9e8b916f..14db24c2 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -35,6 +35,22 @@ export default defineConfig([ external: ['vscode'], }, + { + input: { Main: './lana/src/Main.web.ts' }, + output: { + format: 'cjs', + dir: './lana/out/web', + entryFileNames: 'Main.web.js', + chunkFileNames: 'lana-[name].js', + sourcemap: false, + keepNames: true, + minify: production, + }, + tsconfig: production ? './lana/tsconfig.json' : './lana/tsconfig-dev.json', + platform: 'browser', + external: ['vscode'], + plugins: [nodePolyfills()], + }, { input: { bundle: './log-viewer/src/Main.ts' }, output: [ diff --git a/rollup.config.mjs b/rollup.config.mjs index 10807fc7..347752b4 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -60,6 +60,36 @@ export default [ ), ], }, + { + input: './lana/src/Main.web.ts', + output: { + format: 'cjs', + dir: './lana/out/web', + entryFileNames: 'Main.web.js', + chunkFileNames: 'lana-[name].js', + sourcemap: false, + }, + external: ['vscode'], + plugins: [ + nodeResolve({ browser: true, preferBuiltins: false }), + commonjs(), + json(), + nodePolyfills(), + swc( + defineRollupSwcOption({ + include: /\.[mc]?[jt]sx?$/, + exclude: /node_modules/, + tsconfig: production ? './lana/tsconfig.json' : './lana/tsconfig-dev.json', + jsc: { + minify: { + compress: production ? { keep_classnames: true, keep_fnames: true } : false, + mangle: production ? { keep_classnames: true } : false, + }, + }, + }), + ), + ], + }, { input: { bundle: './log-viewer/src/Main.ts' }, // @vscode-elements ships tsc output with the inline `(this && this.__decorate)` helper.