expand option in grunt-contrib-copy

来源:互联网 发布:java简单工厂模式 编辑:程序博客网 时间:2024/05/28 18:42
http://stackoverflow.com/a/16978014/2177408


Expand lets you specify whether you want to create the destination path in full (e.g: /path/missing1/missing2), or only create the last directory when its parent exists (/path/existing/missing).


http://stackoverflow.com/a/28900435/2177408

down vote

Since expand is a part of Grunt, and not specific for grunt-contrib-copy, information about it can be found in Grunt's file configuration API:

Set expand to true to enable the following options:

  • cwd All src matches are relative to (but don't include) this path.
  • src Pattern(s) to match, relative to the cwd.
  • dest Destination path prefix.
  • ext Replace any existing extension with this value in generated dest paths.
  • extDot Used to indicate where the period indicating the extension is located. Can take either 'first' (extension begins after the first period in the file name) or 'last' (extension begins after the last period), and is set by default to 'first'.
  • flatten Remove all path parts from generated dest paths.
  • rename This function is called for each matched src file, (after extension renaming and flattening). The dest and matched src path are passed in, and this function must return a new dest value. If the same dest is returned more than once, each src which used it will be added to an array of sources for it.

Additionally it seems like dest will always be considered to be a destination directory if setting expand to true.

down vote

Since expand is a part of Grunt, and not specific for grunt-contrib-copy, information about it can be found in Grunt's file configuration API:

Set expand to true to enable the following options:

  • cwd All src matches are relative to (but don't include) this path.
  • src Pattern(s) to match, relative to the cwd.
  • dest Destination path prefix.
  • ext Replace any existing extension with this value in generated dest paths.
  • extDot Used to indicate where the period indicating the extension is located. Can take either 'first' (extension begins after the first period in the file name) or 'last' (extension begins after the last period), and is set by default to 'first'.
  • flatten Remove all path parts from generated dest paths.
  • rename This function is called for each matched src file, (after extension renaming and flattening). The dest and matched src path are passed in, and this function must return a new dest value. If the same dest is returned more than once, each src which used it will be added to an array of sources for it.

Additionally it seems like dest will always be considered to be a destination directory if setting expand to true

0 0
原创粉丝点击