将js文件连接到单个文件时删除modules.exports

Removing modules.exports when concatinating js files into a single file

本文关键字:文件 删除 modules exports js 连接 单个      更新时间:2023-09-26

使用mocha进行单元测试,但需要将所有小文件合并为一个javascript文件。Grunt似乎有办法做到这一点,但不清楚如何处理每个文件中执行测试所需的module.exports。例如:module.exports={策略:策略};

这是前端代码。

如果我理解正确,您使用的是CommonJS require('...')s and模块。exports`?在browserify中,它将运行所有文件,并根据依赖关系将它们连接起来。有一个grunt插件。