Configure grunt copy task to exclude files/folders

后端 未结 5 1344
甜味超标
甜味超标 2020-12-01 09:04

I have installed the grunt task grunt-contrib-copy. I embedd it in my Gruntfile.js and load the task via grunt.loadNpmTasks(\'grunt-contrib-c

5条回答
  •  被撕碎了的回忆
    2020-12-01 09:30

    If you have the liberty to change to a different Grunt task:

    There is also https://github.com/clavery/grunt-copy-to which has an explicit "ignore" option to specify files and directories to omit. The README in Github shows an example configuration including ignore options.

    It works a bit different from the regular copy as it honours the modification times. But that might actually be welcome (it was in my case).

    From the README:

    Like grunt-contrib-copy but only copies files that are newer and maintains modified times for copied files. Useful for creating build directories that can be later synced using tools that rely on file modified times.

    (I'm only a user of that project (at least so far).)

提交回复
热议问题