How can I convert a multi-file node.js app to a single file?

后端 未结 4 1704
醉酒成梦
醉酒成梦 2020-12-31 00:16

If I have a node.js application that is filled with many require statements, how can I compile this into a single .js file? I\'d have to manually r

4条回答
  •  情书的邮戳
    2020-12-31 00:58

    You can use webpack with target: 'node', it will inline all required modules and export everything as a single, standalone, one file, nodejs module

    http://webpack.github.io/docs/configuration.html#target

提交回复
热议问题