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

后端 未结 4 1703
醉酒成梦
醉酒成梦 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:53

    Try below:

    1. npm i -g @vercel/ncc

    2. ncc build app.ts -o dist

    see detail here https://stackoverflow.com/a/65317389/1979406

提交回复
热议问题