I am using gulp.js task manager in my AngularJS and Django project.
Due to my git repository configuration, the static directory, called assets
is not controlled, so I have a directory, sources
, where the source files are.
I'm doing a task to copy these files (initially raw, compressed, etc.) to the folder assets
by doing this:
// Configuración
var config = {
sourcesDir: './sources',
bowerDir: './bower_components'
}
// tarea fuentes
gulp.task('fuentes', function(){
gulp.src([config.sourcesDir + '/css/styles.css'])
.pipe(gulp.dest('./assets/css'));
});
That is, a single file moves from the source src
to the destination dest
seamlessly.
My problem is that I am making angular services with the same Django structure and I have several directories with one or more files inside a javascript folder, like this:
js
├── auth
├── cmi.js
├── indicadores
│ ├── encuestas
│ └── productividad
├── inecap
└── metas
Question: How do I configure my task fuentes
to copy the files js
and structure from the source [config.sourcesDir + '/js']
to the destination ./assets/js
?
You can try this:
For all:
For only the type that is indicated (example with .js):
examples:
js/**/*.js matches files ending in
.js
within the directoryjs
and within all sub-folders of it.js/yourSourceDirectory/exactly.js exactly matches the file.
js/yourSourceDirectory/*.js matches files ending in
.js
inside thejs/suDirectorioSource
.!js/yourSourceDirectory/exclude.js specifically excludes the file
excluir.js
with the use of!.js
or.css
inside the directorySource/