useref icon indicating copy to clipboard operation
useref copied to clipboard

Question: use different functions for different code blocks

Open rowild opened this issue 7 years ago • 3 comments
trafficstars

In my case, i have a js block with vendor files, all in ES5 and already ugli-/minified. They only need to be concatenated and renamed to a "vendor.js" file using a simple gulp-concat() command in a separate gulp-task "vendor-js".

In a second block, though, I have my own stuff, written in ES2015. This block needs a different gulp task, with babel enabled, to transpile them to ES5 again. The gulp task is called "js-es6".

My question: is it possible to tell useref to use one process for "vendor-js" and one for "js-es6"?

Thank you!

rowild avatar Feb 07 '18 22:02 rowild

Sounds like you don't need to use useref for the vendor-js task. But I guess you could use useref for each task.

jonkemp avatar Feb 08 '18 14:02 jonkemp

@jonkemp Well, during development vendor libs will be added or removed, and in some cases order matters. Organising them in one central place would be a great advantage. - How would you tell useref to use separate tasks for each HTML block defined?

rowild avatar Feb 08 '18 14:02 rowild

Oh, I suppose custom blocks might work, but yeah there's not another way to do that.

jonkemp avatar Feb 08 '18 14:02 jonkemp