我正在使用https://github.com/allegro/grunt-maven-plugin用于构建我的 Java + Angular JS 应用程序,我不想每次构建它时都下载 Node 模块。
根据 https://github.com/allegro/grunt-maven-plugin 上的注释,它说使用 tar-ed node_modules 而不是在每次构建期间运行 npm install 。
现在如何创建压缩后的node_modules?我猜测,它是某种压缩目录的方式,但不确定。可以通过 winzip、7zip 等工具吗?或者我是否需要再使用一个 Node 模块来实现这一目标?
最佳答案
阅读https://github.com/allegro/grunt-maven-plugin我知道您不需要对模块进行 tar。
重要的一点是,如果存在名为“target-grunt”的文件夹,其中包含名为“node_modules”的文件夹,则使用离线工作流程。
因此,您可以尝试将实际的 node_modules 文件夹复制到名为“target-grunt”的新文件夹。
关于node.js - 如何创建 tar 压缩的 npm 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32963392/