How to correctly build NestJS app for production with node_modules dependencies in bundle?

前端 未结 1 1839
無奈伤痛
無奈伤痛 2021-02-14 12:42

After nest build or nest build --webpack dist folder does not contain all required modules and I got Error: Cannot find module \'@nestjs/core\'

相关标签:
1条回答
  • 2021-02-14 13:21

    Out of the box, nest cli does not support including the node_modules dependencies into the dist bundle.


    However, there are some community examples of custom webpack configs that include the dependencies in the bundle, e.g. bundled-nest. As described in this issue, it is necessary to include the webpack.IgnorePlugin to whitelist unused dynamic libraries.

    0 讨论(0)
提交回复
热议问题