How to optimize the code size of node modules when publishing applications? Remove useless documents?

  node.js, question

I found that some node module contain some useless files, such as development files or description files. I want to ask, when I actually release the application, is there any automated method to remove these unnecessary files?

Thank you very much

The general issue is not a build file.