To concatenate two files, it looks something like this:
concat: {
src: ['common.js','js/app.js'],
dest: 'assets/js/app.js'
}
And if I want to concat an entire folder of files into one, it looks something like this:
concat: {
src: ['dev/*.js','],
dest: 'prod/js/app.js'
}
But let's say I have a file that I want to concat onto 10 or 20 other files, and I want them to concat separately? In other words, here is what I'm looking for:
A.js + B.js = AB.js
A.js + C.js = AC.js
A.js + D.js = AD.js
A.js + E.js = AE.js
And so on... To be more specific though, I can figure out how to concat files one by one as described, but I want to figure out how to specify A.js from the example, and have it concat onto any file in a specified path. So what I want is:
A.js + dev/*.js = AB.js, AC.js, AD.js, AE.js ...
In pseudo-code, here is what I want:
concat: {
src: ['common.js', 'dev/*.js','], // common.js gets concatenated to each file in this directory
dest: 'prod/js/*.js' // each file in src gets saved separately in dest
}
I'd appreciate any help, I've have a hard time finding info on how to do this
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…