gruntjs - grunt-contrib-copy error (Error code: ENOENT) -


i searched internet , looks me had problem grunt-contrib-copy.

project   gruntfile.js   ->app      ->img         ->pic1.png         ->pic2.png 

result expected:

project   gruntfile.js   ->app      ->dist         ->img            ->pic1.png            ->pic2.png      ->img         ->pic1.png         ->pic2.png 

in word, copy files in /project/app/img /project/app/dist/img.

here copy config, not working:

copy: {   main: {     src: ['*.*'],     expend: true,     cwd: 'app/img/',     dest: 'app/dist/img/'   } }, 

here error message: warning: unable read "download.png" file (error code: enoent). use --force continue.

(download.png name of picture file)

how should config copy option? thank you!

it looks have typo, should expand instead of expend. cwd property being ignored. try following config instead:

copy: {   main: {     src: ['**/*'],     expand: true,     cwd: 'app/img/',     dest: 'app/dist/img/'   } }, 

the glob pattern *.* not necessary * match files (unless you're trying match only files . in them.) try using src: '*' match files within single folder or src: '**/*' match files , folders within cwd.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -