H
H
HoHsi2015-10-11 09:24:56
JavaScript
HoHsi, 2015-10-11 09:24:56

Why doesn't gulp.js copy the folder?

Good day!
Faced such a problem. Started rewriting my gulp and changed its structure. Without any extra water, the project looks like this:

/development/ # под исходники Coffee
/production/     # под собранные файлы в JS
/release/           # под Zip с файлами на продакшн
/*.js
/*.json

Actually, you need to copy the whole thing, except for development and empty folders, into a zip archive in release.
"./#{folders.production}/**/*"
"./*"
"!./"
"!./#{folders.development}/**/*"
"!./#{folders.docs}/**/*"
"!./#{folders.backup}/**/*"
"!./#{folders.release}/**/*"

Those. we say, "copy everything from the root, as well as the rendered files, but don't touch the docks, backups, sources and yourself."
But it infectively copies everything from the production folder to the root of the archive, copies all the files from the folder root, and copies the forbidden folders empty, without their contents.
How to make a rule that prohibits copying a folder and its contents?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HoHsi, 2015-10-11
@HoHsi

The solution is quite simple: CoffeeScript
base is appended to gulp.src

gulp.src "./path/to/coffee/or/any/*.coffee", { base: './' }
    .pipe gulp.dest "./js/"

In this case, everything will be rendered
in ./js/path/to/coffee/or/any/*.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question