Grunt copy a single file

What is the format to specify a single file copy for grunt copy task

                    cwd:'<%= %>',
                    dest:'<%= yeoman.dist %>/scripts/jq.min.js',
                    src: ['components/jq/dist/jq.min.js']

if my dir is A and yeoman.dist is B, this copies the file to

  • gruntjs - where to install tasks?
  • does it make sense to browserify polymer elements` js?
  • Grunt 'grunt-bower-concat', ignoring mainFiles option
  • File watcher for less in grunt not updating css
  • Getting a strange error with grunt: Object Gruntfile.js has no method 'flatten'
  • Installing two different versions of grunt on one machine
  • /b/scripts/jq.min.js/components/jq/dist/jq.min.js

    what I want is copy it as /b/scripts/jq.min.js

    how can I do this.

    I see an issue which implements the support.

  • using grunt-browserify in Gruntfile.js
  • Always-true tests failing in Angularjs — Karma
  • grunt requirejs 'define is undefined'
  • Grunt task(s) to minify single HTML file with CSS and Javascript
  • trying to run grunt tasks for development and prod mode does not run the default task
  • Compile, Concatenate and Minify Sass files with Grunt
  • 2 Solutions collect form web for “Grunt copy a single file”

    Does this work?

    copy: {
        dev: {
            files: [{
                cwd: '<%= %>/components/jq/dist/',
                src: 'jq.min.js',
                dest: '<%= yeoman.dist %>/scripts/',
                expand: true

    Copy multiple source file locations to a single destination folder use flatten.

    copy: {
        dev: {
            files: [{
                cwd: '<%= %>',
                src: ['/components/jq/dist/jq.min.js','/components/jq/dist/jq2.min.js', '/components/bs/dist/bs.js'],
                dest: '<%= yeoman.dist %>/scripts/',
                expand: true,
                flatten: true