【问题标题】:Remove Original file after rename with grunt_copy使用 grunt_copy 重命名后删除原始文件
【发布时间】:2017-04-30 23:27:11
【问题描述】:

我想在使用 grunt 复制选项重命名文件后删除原始文件。 文件重命名成功 但是,原始文件保留不删除。 在下面找到我的代码。

rename: {
        files: [
            {
                expand: true,
                flatten: true,
                cwd: '.tmp/public/min',
                src: ['production.*.*'],
                dest: '.tmp/public/min/',
                rename: function(dest, src) {
                return dest + src.replace('production','production.v'+timestamp);
            }
            }]
    },

这是我使用的模块,

grunt-contrib-copy

【问题讨论】:

  • 你必须使用 grunt-contrib-clean 来删除文件。
  • @Vishwanath,它已经很老了,无法再维护了。不推荐。

标签: javascript gruntjs sails.js grunt-contrib-copy


【解决方案1】:

您可以使用grunt-contrib-clean 删除文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-06
    • 1970-01-01
    • 1970-01-01
    • 2012-08-15
    • 2023-02-08
    相关资源
    最近更新 更多