From faea6fe2e8372b26577082175541c6c85c610abc Mon Sep 17 00:00:00 2001 From: Ze-Hao Wang Date: Sun, 16 Jul 2023 22:35:20 +0800 Subject: [PATCH] fix: update @koa/multer import keyword in koa.hbs --- packages/cli/src/routeGeneration/templates/koa.hbs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cli/src/routeGeneration/templates/koa.hbs b/packages/cli/src/routeGeneration/templates/koa.hbs index a4cb818d3..458b09394 100644 --- a/packages/cli/src/routeGeneration/templates/koa.hbs +++ b/packages/cli/src/routeGeneration/templates/koa.hbs @@ -21,7 +21,11 @@ import type { IocContainer, IocContainerFactory } from '@tsoa/runtime'; import type { Middleware } from 'koa'; import type * as KoaRouter from '@koa/router'; {{#if useFileUploads}} +{{#if esm}} +import multer from '@koa/multer'; +{{else}} const multer = require('@koa/multer'); +{{/if}} const upload = multer({{{json multerOpts}}}); {{/if}}