Questions tagged [grunt-contrib-copy]

Copy files and folders.

Grunt task to copy files and folders.

131 questions
31
votes
1 answer

grunt-contrib-copy - ignore folder when copying

Given the following source tree: dev 丨- psd 丨- psd.psd 丨- png.png 丨- css 丨- css.css 丨- image 丨- 1.jpg 丨- 2.png 丨html.html How do I copy to the pub directory ignoring the psd folder as seen below? pub 丨- css 丨-…
kimsagro
  • 15,513
  • 17
  • 54
  • 69
27
votes
2 answers

How to copy files without the full path with grunt.js?

I want to copy the content of /pckg to /dist with grunt.js. Here is the structure: |-- folder1 | | | |-- folder2 | | | |-- pckg | | | |--myfolder | | | …
alienlebarge
  • 3,008
  • 5
  • 24
  • 26
17
votes
1 answer

How to get Grunt-Contrib-Copy to copy files/directories relative to given source path

First time using this task and what I'm trying to achieve is the following: copy all directories/files from src/js/bower_components/* to build/assets/js/vendor/ I've tried using cwd property but it doesn't work at all when I use it.. I've set it…
micahblu
  • 4,924
  • 5
  • 27
  • 33
14
votes
1 answer

Grunt Copy Flatten not working as expected

I have a directory structure as follows: source/ libraries/ d3.js lodash.js //etc I have grunt-copy setup as follows: copy: { main: { files: [ { src: ["source/libraries/*.js"], dest:…
dandelion
  • 1,742
  • 1
  • 15
  • 18
11
votes
3 answers

When I run Grunt, I receive the following message: Local npm module "grunt-contrib-copy" not found. Is it installed?

I have been trying to install Grunt. When I run grunt I receive the following list of messages and warnings: Local Npm module "grunt-contrib-copy" not found. Is it installed? Local Npm module "grunt-contrib-uglify" not found. Is it…
11
votes
2 answers

grunt-contrib-copy: Multiple Copy Tasks

Was just wondering if it's possible to set the 'copy' task to do selective copies? Say, if one task wanted to target some files for copying, while another task may want to target others. I see the 'main' is used in all the examples, but I can't…
Keith DC
  • 661
  • 1
  • 9
  • 24
10
votes
1 answer

Grunt-contrib-copy task is failing when cwd option is specified

I have this grunt-copy setup: copy: { images: { cwd: 'src/multiselect/lib/', src: 'chosen.css', dest: './built/css/', flatten: true, filter: 'isFile' } }, And when I…
Capaj
  • 4,024
  • 2
  • 43
  • 56
7
votes
2 answers

Grunt Watch Event with Grunt Copy for Only Changed Files

Okay I've been stuck on this for 2 weeks, so hopefully someone else here has run across this problem. I'm trying to use Grunt to copy only files that have changed. I've seen numerous examples of how to do this with JSLINT and UGLIFY but no…
6
votes
2 answers

grunt-contrib-copy syntax for process option confusion

I'm trying to replace some placeholders in different files as I copy. My gruntfile works fine, but adding in the process option to do the replacements, it's just not working. Below is the relevant section of my gruntfile: grunt.initConfig({ …
Steve Taylor
  • 1,871
  • 4
  • 16
  • 18
5
votes
2 answers

Grunt - Can you call grunt-contrib-copy from within a custom registered task and customize the copy on the fly?

I know I can setup a task in grunt.config that will grunt-contrib-copy files from src to dest, and looking through Grunt docs I know I can copy single files using grunt.file.copy. But, is it possible to create grunt-contrib-copy tasks on the fly in…
mtpultz
  • 17,267
  • 22
  • 122
  • 201
4
votes
2 answers

Copy folder structure from src/ to dist/ using grunt-contrib-copy

I have a folder structure that looks like this I want to copy the folder img/ from src/ to the dist/ folder. I use the following grunt command, using grunt-contrib-copy: copy:{ main : { files : [ { …
petur
  • 1,366
  • 3
  • 21
  • 42
4
votes
1 answer

Corrupted copy using grunt-contrib-copy

I have an issue when copy a lot of files (images, pdf, etc) from one directory to another one. In a destination folder all these files is corrupted. I tried to use both noProcess and processContentExclude options but it brought no results. My copy…
Volodymyr Machula
  • 1,564
  • 1
  • 15
  • 20
4
votes
1 answer

What does "Verifying property ___ exists in config" mean in Grunt?

I have a simple Gruntfile written in Coffeescript: "use strict" module.exports = (grunt) -> config = src: "app" dist: "build" grunt.initConfig = config: config copy: dist: files:…
Liam
  • 1,041
  • 2
  • 17
  • 31
3
votes
1 answer

More efficient way of copying dist files in Grunt?

New to gruntjs and currently using it for moving some npm distributions to a public/js folder. Here is the code: module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), …
tomaytotomato
  • 3,788
  • 16
  • 64
  • 119
3
votes
1 answer

Running tasks sequentially in Grunt

I was under the impression that in grunt.registerTask(taskName, taskList) the taskList would run sequentially (i.e. one completes before moving onto the next). I guess that is not the case? Given this task: grunt.registerTask('local-debug', [ …
mrshickadance
  • 1,213
  • 4
  • 20
  • 34
1
2 3
8 9