diff --git a/crates/vite_task_graph/run-config.ts b/crates/vite_task_graph/run-config.ts index 7944ae70..4b0c4c48 100644 --- a/crates/vite_task_graph/run-config.ts +++ b/crates/vite_task_graph/run-config.ts @@ -1,27 +1,3 @@ -export type UserGlobalCacheConfig = - | boolean - | { - /** - * Enable caching for package.json scripts not defined in the `tasks` map. - * - * When `false`, package.json scripts will not be cached. - * When `true`, package.json scripts will be cached with default settings. - * - * Default: `false` - */ - scripts?: boolean; - /** - * Global cache kill switch for task entries. - * - * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. - * When `true`, respects each task's individual `cache` setting - * (each task's `cache` defaults to `true` if omitted). - * - * Default: `true` - */ - tasks?: boolean; - }; - export type Task = { /** * The command to run for the task. @@ -60,6 +36,30 @@ export type Task = { } ); +export type UserGlobalCacheConfig = + | boolean + | { + /** + * Enable caching for package.json scripts not defined in the `tasks` map. + * + * When `false`, package.json scripts will not be cached. + * When `true`, package.json scripts will be cached with default settings. + * + * Default: `false` + */ + scripts?: boolean; + /** + * Global cache kill switch for task entries. + * + * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. + * When `true`, respects each task's individual `cache` setting + * (each task's `cache` defaults to `true` if omitted). + * + * Default: `true` + */ + tasks?: boolean; + }; + export type RunConfig = { /** * Root-level cache configuration. diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index bf55eaec..d8d784d6 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -225,6 +225,9 @@ impl UserRunConfig { let mut collector = DeclCollector(Vec::new()); Self::visit_dependencies(&mut collector); + // Sort declarations for deterministic output order + collector.0.sort(); + // Export all types let mut types: String = collector .0