繁体   English   中英

如何以自定义方式将js文件与grunt.js合并?

[英]How to combine js file in a custom way with grunt.js?

我想要基于标记的搜索并替换grunt的功能。

喜欢

  single:{
                input:"./input.js",
                output:"./output.js",
                tokens:[{
                    token:"$1",
                    file:"./file.js"
                },{
                    token:"%2",
                    string:"replacement string"
                },{
                    token:"!3",
                    file:"./file.txt"
                }]
            },

来自.. grunt-combine https://github.com/mcgaryes/grunt-combine/

grunt .4版本不支持此功能。 是否有任何类似的库..或默认情况下没有“ concat”方法,我们可以这样做吗?

也许您正在寻找类似grunt-replace的东西?

从文档:

replace: {
  dist: {
    options: {
      variables: {
        'key': 'value'
      }
    }
  }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM