31 lines
995 B
JavaScript
31 lines
995 B
JavaScript
import { build } from 'esbuild'
|
|
|
|
await build({
|
|
entryPoints: ['scripts/claude-kernel-integration.ts'],
|
|
outfile: '.tmp/claude-kernel-integration.mjs',
|
|
bundle: true,
|
|
platform: 'node',
|
|
format: 'esm',
|
|
external: ['@anthropic-ai/claude-agent-sdk'],
|
|
logLevel: 'warning',
|
|
banner: {
|
|
js: `import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);`
|
|
},
|
|
plugins: [{
|
|
name: 'claude-kernel-electron-stub',
|
|
setup(plugin) {
|
|
plugin.onResolve({ filter: /^electron$/ }, () => ({ path: 'electron', namespace: 'claude-test' }))
|
|
plugin.onLoad({ filter: /.*/, namespace: 'claude-test' }, () => ({
|
|
loader: 'js',
|
|
contents: `
|
|
export const app = {
|
|
getPath: (name) => name === 'userData' ? process.env.CLAUDE_TEST_USER_DATA : process.cwd(),
|
|
getAppPath: () => process.cwd()
|
|
};
|
|
export const safeStorage = { isEncryptionAvailable: () => false };
|
|
`
|
|
}))
|
|
}
|
|
}]
|
|
})
|