Questions tagged [grunt-contrib-copy]

Copy files and folders.

Grunt task to copy files and folders.

131 questions
1
vote
1 answer

Grunt-Contrib-Copy, how to copy contents of a directory keeping the same folder structure without overwriting existing files/folders in dest folder?

Source Structure ``` folder |----Sub-Folder-1 | |-a.js | |-b.js |----Sub-Folder-2 | |-c.js |-d.js |-e.js ``` Destination structure before running copy task ``` folder |----Sub-Folder-1 | |-a.js |-e.js ``` I need the destination folder…
John Doe
  • 328
  • 3
  • 12
1
vote
1 answer

gunrt-contrib-copy renaming file extensions

i have a directory and a number of sub directories so when i look for my files i use a globbing pattern like 'src/**/*.js' the trouble is i want to rename extension to .old.js the snag is i need the .old.js file to be renamed and stay in the…
user1383163
  • 577
  • 1
  • 7
  • 24
1
vote
1 answer

grunt copy folder with absolute path in windows

I created a grunt copy task in with the below settings {expand: true, src: ['E:\\Temp\\Copy1\\*'], dest: 'E:\\Temp\\Copy2\\', filter: 'isFile'}, I get the following error. how to I copy from absolute path? Warning: Unable to create directory…
kumar
  • 8,207
  • 20
  • 85
  • 176
1
vote
1 answer

Grunt subtask inside another subtask

can we define Grunt subtask inside another subtask? I tried as follows and its not work. copy: { general : { fonts : { src: ['<%=src.font %>'], dest: '<%= distdir %>/assets/fonts', …
1
vote
0 answers

Using grunt-contrib-sass to compile to multiple destinations relative to their sources (recursively)

I have a huge stylesheet codebase with many .scss files in multiple folders and subfolders that I want to compile to .css files. So far so good. But for whatever reason I need the .css files to be compiled into a different destination folder than…
1
vote
0 answers

Copying directories and their contents using grunt-contrib-copy

I am using grunt-contrib-copy and trying to copy the contents of my src folder into my dist folder, while excluding some directories. src ├── bower_components │ └── ... ├── components │ ├── html5shiv.js │ └── jquery.min.js ├── js │ └──…
jonyonsno
  • 11
  • 5
1
vote
1 answer

Grunt copy / ant pattern / omit variable directory

I need copy files from folder src/plugin@x.x.x to dist/plugin. Version can be changed so I want to omit version number everywhere. I do: files[{ cwd: 'src' src: 'plugin@*/**/*' dest: 'dist/plugin' }]; But it copy my files to…
OKey
  • 182
  • 1
  • 2
  • 10
1
vote
1 answer

Grunt And bower automatic dependency

I am using bower And grunt for my web app, by now I had some issues trying to import resources to the dist/ directory. I am using material design icons but I need just few of them. By now the only chance that I've got is to manually tell grunt what…
Gianmarco
  • 2,536
  • 25
  • 57
1
vote
0 answers

how to copy a single file in each directory

I would like to configure and execute a task that copies a specified file in each dir recursively. In specific I would like to have "index.php" copied in each directory and subdirectory of my web project, if that doesn't exist. I've tried to use…
Bertuz
  • 2,390
  • 3
  • 25
  • 50
1
vote
2 answers

Problems copying many folders

I'm pretty new to grunt, so I need some help. I ask this question on the official gruntjs/grunt-contrib-copy but got no response. I want to copy files using grunt-contrib-copy from some dir to another and they look like this: parentpath/ (source…
Vinicius Garcia
  • 1,740
  • 4
  • 30
  • 54
1
vote
1 answer

loop grunt task thru forEach to duplicate a task with an array lenght

Can't get the right solution with Grunt JS task runner, so here is my question. Goal : duplicate a task a number of times. The number of times is the length of an Array.In the array, there are "names" which I use to build the paths ( sources and…
Klark
  • 31
  • 7
1
vote
2 answers

Can Grunt tasks navigate "up" from the folder they are run in?

I am trying to structure my assets so that multiple projects can share a "phase" of the build script. For example, if I have 3 web-based products that all use Bootstrap and jQuery, I want to only source the libraries from a shared "library". The…
Greg Pettit
  • 10,749
  • 5
  • 53
  • 72
1
vote
2 answers

How to skip a Grunt target by default

I'm defining a Grunt project with multiple tasks and targets, with task build, I would like to run some copy targets, and then with task deployment, I also want to run copy however with some other targets (only copy folder to specific directory for…
Khoi Nguyen
  • 1,072
  • 2
  • 15
  • 32
1
vote
1 answer

grunt-contrib-copy copy directory into another without root dir

I am trying to copy a structure like so: src |-a |-b |-c ||-ca ||-cb dest |-a |-b |-c ||-ca ||-cb However, I appear to not be able to accomplish this without the src directory itself appearing in the dest directory.…
Fraser
  • 14,036
  • 22
  • 73
  • 118
1
vote
1 answer

Why is grunt-contrib-copy writing all my files with the same name?

I'm running grunt-contrib-copy to copy a set of images from one directory to another. All of the files are getting copied, but each copy is being written with the name of the first file in the queue so I'm ending up with only one file. Here's my…
Jack Roscoe
  • 4,293
  • 10
  • 37
  • 46
1 2
3
8 9