Open
Description
I write a simple build task and a custom plugin usemin
as following.
I thought the files
argument of the generator function in the usemin
plugin should be .tmp/index.html
but, I found that I'm wrong, it contains all the files which returned by the html
task.
so why things become so weird? (maybe I should post this question on stackoverflow. sorry ....
export async function compile(task) {
await task.start('clear');
await task.parallel(['script', 'style', 'image', 'font', 'other', 'html']);
}
export async function build(task) {
await task.start('compile');
await task.source('.tmp/index.html').usemin({
staticDir: c.build,
}).target(c.build);
}
module.exports = function (task, utils) {
// ...
task.plugin('usemin', { every: false }, function* (files, opts) {
console.log(files.map(o=>o.dir).filter(o=>o.indexOf('.tmp')!==-1));
// [] (empty array)
});
}
Metadata
Metadata
Assignees
Labels
No labels
Activity