update noExternal

This commit is contained in:
Andrew Pareles 2024-11-14 01:06:15 -08:00
parent 13f6fd5c66
commit bd49aaffde
4 changed files with 13 additions and 4 deletions

View file

@ -6,6 +6,7 @@
"esModuleInterop": true,
},
"include": [
"./src/**/*.ts"
"./src/**/*.ts",
"./src/**/*.tsx"
]
}

View file

@ -3,8 +3,8 @@ import { defineConfig } from 'tsup'
export default defineConfig({
entry: [
'./src2/sidebar-tsx/Sidebar.tsx',
'./src2/util/sendLLMMessage.ts',
'./src2/util/posthog.ts',
'./src2/util/sendLLMMessage.tsx',
'./src2/util/posthog.tsx',
],
outDir: './out',
format: ['esm'],
@ -17,7 +17,15 @@ export default defineConfig({
injectStyle: true, // bundle css into the output file
outExtension: () => ({ js: '.js' }),
// default behavior is to take local files and make them internal (bundle them) and take imports like 'react' and leave them external (don't bundle them), we want the opposite in many ways
noExternal: ['react', 'react-dom'], // noExternal means we should take these things and make them not external (bundle them into the output file)
noExternal: [ // noExternal means we should take these things and make them not external (bundle them into the output file)
'react',
'react-dom',
'posthog-js',
'@google/generative-ai',
'ollama',
'@anthropic-ai/sdk',
'openai',
],
external: [ // these imports should be kept external ../../../ are external (this is just an optimization so the output file doesn't re-implement functions)
new RegExp('../../../*'
.replaceAll('.', '\\.')