[AI] Address review feedback for browser API build

- Remove `internal` export from index.web.ts (keep as local variable)
- Use `yarn build:node && yarn build:browser` in build script
- Remove unnecessary `node:` external from vite.browser.config.ts
  (Vite handles browser externalization automatically)

https://claude.ai/code/session_01MnxRXLNjqXrVb5CdsC85Fb
This commit is contained in:
Claude
2026-03-17 12:04:21 +00:00
parent 332db28e2e
commit 3e2303e5dc
3 changed files with 2 additions and 9 deletions

View File

@@ -4,8 +4,7 @@ import type { InitConfig, lib } from '@actual-app/core/server/main';
export * from './methods'; export * from './methods';
export * as utils from './utils'; export * as utils from './utils';
/** @deprecated Please use return value of `init` instead */ let internal: typeof lib | null = null;
export let internal: typeof lib | null = null;
export async function init(config: InitConfig = {}) { export async function init(config: InitConfig = {}) {
internal = await initLootCore(config); internal = await initLootCore(config);

View File

@@ -38,7 +38,7 @@
} }
}, },
"scripts": { "scripts": {
"build": "vite build && vite build --config vite.browser.config.ts", "build": "yarn build:node && yarn build:browser",
"build:node": "vite build", "build:node": "vite build",
"build:browser": "vite build --config vite.browser.config.ts", "build:browser": "vite build --config vite.browser.config.ts",
"test": "vitest --run", "test": "vitest --run",

View File

@@ -16,12 +16,6 @@ export default defineConfig({
formats: ['es'], formats: ['es'],
fileName: () => 'browser.js', fileName: () => 'browser.js',
}, },
rollupOptions: {
external: [
// These are browser APIs provided by the environment
/^node:/,
],
},
}, },
plugins: [peggyLoader()], plugins: [peggyLoader()],
resolve: { resolve: {