Skip to content

Commit

Permalink
fix: register with new defaultTaskConfig evey time (#6726)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertXiao1994 authored Jan 5, 2024
1 parent 2e4449f commit 910f443
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ice/src/createService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ async function createService({ rootDir, command, commandArgs }: CreateServiceOpt
generatorAPI.addExport(exports);
});
const routeManifest = new RouteManifest();
// Merge task config with default config, so developer should not care about the config built-in of framework.
const defaultTaskConfig = getDefaultTaskConfig({ rootDir, command });
const ctx = new Context<Config, ExtendsPluginAPI>({
rootDir,
command,
Expand All @@ -194,6 +192,8 @@ async function createService({ rootDir, command, commandArgs }: CreateServiceOpt
createLogger,
// Override registerTask to merge default config.
registerTask: (target: string, config: Partial<Config>) => {
// Merge task config with default config, so developer should not care about the config built-in of framework.
const defaultTaskConfig = getDefaultTaskConfig({ rootDir, command });
return ctx.registerTask(target, mergeConfig(defaultTaskConfig, config));
},
},
Expand Down

0 comments on commit 910f443

Please sign in to comment.