Skip to content

Commit

Permalink
Load tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
claushellsing committed Aug 27, 2024
1 parent 429f8bd commit a0d8884
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { Parser } from 'acorn';
import estraverse from 'estraverse';

export interface ViteConfig {
plugins: Array<unknown>
plugins: Array<unknown>,
root: string,
}

// Function to determine if the file is a story file
Expand Down Expand Up @@ -49,6 +50,7 @@ export function viteDependencyPlugin(config: ViteConfig): Plugin {
const tree = dependencyTree({
filename: id,
directory: basePath,
tsConfig: `${config.root}/tsconfig.json`, //Todo: pass as parameter
filter: (path: string) =>
path.indexOf('node_modules') === -1 && path !== id && !path.endsWith('.css'),
});
Expand Down

0 comments on commit a0d8884

Please sign in to comment.