Skip to content

Commit 2f297a6

Browse files
committed
feat(code-gen): generate route tags as const
1 parent 45cc0d6 commit 2f297a6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/code-gen/src/router/js-koa.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,12 @@ export function jsKoaWriteTags(file, group, routes) {
269269
}
270270

271271
fileContextSetIndent(file, -1);
272-
fileWrite(file, `};\n`);
272+
273+
if (file.relativePath.endsWith(".js")) {
274+
fileWrite(file, `};\n`);
275+
} else {
276+
fileWrite(file, `} as const;\n`);
277+
}
273278
}
274279

275280
/**

0 commit comments

Comments
 (0)