Folder structure:
project
|
+-coffee
| |
| +-main.coffee
| |
| +-testDir
| | |
| | +-models.coffee
| | |
| | +-views.coffee
| |
| +-anotherDir
| | |
| | +-routes.coffee
| | |
| | +-views.coffee
| | |
| | +-modules.coffee
| |
| +- etc...
|
+-www
The idea is to keep the folder structure from the coffee/
directory when writing files to the www/
directory. There can be an arbitrary number of subfolders in coffee/
. All .coffee
files from each folder should be concatened into a modules.js
file:
www
|
+-modules.js
|
+-testDir
| |
| +-modules.js
|
+-anotherDir
| |
| +-modules.js
|
+- etc...
I currently have this gulp task:
gulp.task('coffee', function() {
gulp.src('./coffee/**/*.coffee', {base: './coffee/'})
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(uglify())
// .pipe(concat('modules.js'))
.pipe(gulp.dest('./www'))
});
Without the concat()
the files are placed into the correct subfolders (but they're not concatened). With the concat()
all files are concatened into a single modules.js
file:
www
|
+-modules.js
How I can realize this correctly?