Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Grunt-在构建时修改JS文件_Javascript_Gruntjs_Production - Fatal编程技术网

Javascript Grunt-在构建时修改JS文件

Javascript Grunt-在构建时修改JS文件,javascript,gruntjs,production,Javascript,Gruntjs,Production,我使用Grunt作为我的任务管理器,并希望在为生产构建捆绑包时更改JS文件。我的主要目标是更改配置文件和其中的数据,因为数据不同。最好的解决方案是什么?我认为grunt文本替换软件包就是您要寻找的。您可以使用grunt的替换模块: 或 我建议您在文件中插入一个密钥,以便在所有环境中通过grunt进行替换

我使用Grunt作为我的任务管理器,并希望在为生产构建捆绑包时更改JS文件。我的主要目标是更改配置文件和其中的数据,因为数据不同。最好的解决方案是什么?

我认为grunt文本替换软件包就是您要寻找的。

您可以使用grunt的替换模块: 或

我建议您在文件中插入一个密钥,以便在所有环境中通过grunt进行替换