this is my current code to copy relevant files from my source to my build dir. It does not work as expected
return gulp.src([
'src/**/*',
'!src/**/*(*.sass|*.scss|*.js)',
'!src/(components|config|elements|less|sass|scss|platforms)',
'src/console.js',
'src/cordova.js',
'src/config.xml',
]).pipe(plugins.copy("www", {prefix: 1}));
My idea is this:
- Select all files and folders in src
- Remove all js and sass files because they get compiled/concat/minified and copied to build in another task
- However console.js and cordova.js have to be copied, so i want to reinclude them into the glob
Well, i thought the elements order in the globArray is a priority or something so that e.g. console.js gets reincluded after it got filtered out. It doesnt seem so :(
What can i do?
So the real issue that you are facing is the lack of ability to 'debug' or 'inspect' what is currently being processed in the gulp stream. In my workflow, two irreplaceable gulp plugins to help with figuring out what is going on are:
gulp-rename
var gutil = require('gulp-util'); var rename = require('gulp-rename');
Now, try appending this code snippet to your example like so:
Then all you have to do is look at the output in your logs to see which files are being processed, and then update your globbing accordingly.
Also, your better off testing your paths one by one or in pairs to see if your on the right track and so you are not overwhelmed when all globs aren't working as expected. Isolate the glob issue and update accordingly.
Also just a hint to get you on the right track, this glob:
needs to be:
I hope this gets you on the right track!