Skip to content

Commit e45558e

Browse files
feat: support for bundling dependencies (#302)
* feat: support for bundling dependencies * rename to bundledDeps * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 73348cb commit e45558e

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.changeset/tall-comics-feel.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@tanstack/vite-config': minor
3+
'@tanstack/config': minor
4+
---
5+
6+
feat: support for bundling dependencies

packages/vite-config/src/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export type Options = {
1515
tsconfigPath?: string
1616
/** Additional dependencies to externalize if not detected by `vite-plugin-externalize-deps` */
1717
externalDeps?: Array<string | RegExp>
18+
/** Dependencies to bundle. Will be passed to the except argument of `vite-plugin-externalize-deps` */
19+
bundledDeps?: Array<string | RegExp>
1820
/** Hook called prior to writing each declaration file; allows to transform the content */
1921
beforeWriteDeclarationFile?: (filePath: string, content: string) => string
2022
}

packages/vite-config/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ export const tanstackViteConfig = (options) => {
3535

3636
return defineConfig({
3737
plugins: [
38-
externalizeDeps({ include: options.externalDeps ?? [] }),
38+
externalizeDeps({
39+
include: options.externalDeps ?? [],
40+
except: options.bundledDeps ?? [],
41+
}),
3942
preserveDirectives(),
4043
tsconfigPaths({
4144
projects: options.tsconfigPath ? [options.tsconfigPath] : undefined,

0 commit comments

Comments
 (0)