Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

nestjs - Delete typescript decorators when importing class from Front-End

I'm using NestJS for my Back-end application. I'm declaring my schema and my Dto with decorators like @Props() @Query() @Schema() @Body() and so on.

I'm also sharing some .ts files with my Front-end so I can also type my front-end code and still have one source of truth inside my whole project.

The problem is. The decorators make my front-end load some node_modules packages when imported. Is there a way to tell typescript not to include decorators, or to stop it from loading inside my node_modules when loading decorators ?

I already tried to "exclude": ["src", "node_modules"], in my tsconfig.json, not working.

question from:https://stackoverflow.com/questions/65941716/delete-typescript-decorators-when-importing-class-from-front-end

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...