File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ export type Options = {
77 srcDir : string
88 /** Excluded from type generation, e.g. `[./src/tests]` */
99 exclude ?: string [ ]
10+ /** Directory where build output will be placed, e.g. `./dist` */
11+ outDir ?: string
1012}
1113
1214export function tanstackBuildConfig ( config : Options ) : UserConfig
Original file line number Diff line number Diff line change @@ -10,12 +10,14 @@ import dts from 'vite-plugin-dts'
1010 * @returns {import('vite').UserConfig }
1111 */
1212export const tanstackBuildConfig = ( options ) => {
13+ const outDir = options . outDir ?? 'dist'
14+
1315 return defineConfig ( {
1416 plugins : [
1517 externalizeDeps ( ) ,
1618 preserveDirectives ( ) ,
1719 dts ( {
18- outDir : 'dist /esm' ,
20+ outDir : ` ${ outDir } /esm` ,
1921 entryRoot : options . srcDir ,
2022 include : options . srcDir ,
2123 exclude : options . exclude ,
@@ -34,7 +36,7 @@ export const tanstackBuildConfig = (options) => {
3436 } ,
3537 } ) ,
3638 dts ( {
37- outDir : 'dist /cjs' ,
39+ outDir : ` ${ outDir } /cjs` ,
3840 entryRoot : options . srcDir ,
3941 include : options . srcDir ,
4042 exclude : options . exclude ,
@@ -56,7 +58,7 @@ export const tanstackBuildConfig = (options) => {
5658 } ) ,
5759 ] ,
5860 build : {
59- outDir : 'dist' ,
61+ outDir,
6062 minify : false ,
6163 sourcemap : true ,
6264 lib : {
You can’t perform that action at this time.
0 commit comments