Open stkevintan opened 6 years ago
Hi! Unfortunately, this is the only quirky behavior that Taskr has. I haven't been able to spend time sorting it out yet.
Taskr's sub-tasks can get, uh, confused if trying to chain/start too many tasks from within tasks.
In this case, you can move task.start('compile')
to after your usemin
task:
export async function build(task) {
await task.source('.tmp/index.html').usemin({
staticDir: c.build,
}).target(c.build);
await task.start('compile');
}
But I recommend keeping all tasks unqiue/simple and then running them from the CLI (or npm script) like this:
export async function build(task) {
await task.source('.tmp/index.html').usemin({
staticDir: c.build,
}).target(c.build);
}
// package.json
{
"scripts": {
"build": "taskr compile build"
}
}
Either of those should work for you. Your plugin is fine 😄
I write a simple build task and a custom plugin
usemin
as following. I thought thefiles
argument of the generator function in theusemin
plugin should be.tmp/index.html
but, I found that I'm wrong, it contains all the files which returned by thehtml
task.so why things become so weird? (maybe I should post this question on stackoverflow. sorry ....