Open danilo-valente opened 9 years ago
This looks good, but from #12 I think we should support a scenario that does not use an output file name or tag template.
No problem. How should AT work on this scenario?
I'm not quite sure, but here are a few ideas:
1) => if no output destination specified, use relative path from asset 2) => if a directory is specified, use that output folder instead of relative path from asset 3) => if a full path is specified, rename file to new name
Potentially, this will allow one or more assets within a directive to be processed and output correctly when concat is not used. There are still a couple of weird cases though:
1) If scenario 1)
or 2)
occur with concat and no output filename is specified, this could be a problem. Perhaps we should use a hash as the default output filename, and replace it with whatever name they provide.
2) If scenario 3)
were to occur with multiple assets and without concat, we could use the hash too.
Otherwise, I guess we need to throw an exception. Thoughts?
I like the idea of hashing the file contents, we could change the getTagTemplate
to calculate and return it. Also, what should be the tag template if neither of tagTemplate
or tag
options are provided? Should we infer it from the file extension?
Yeah, I think so. That's how the "implicit tag" works today. I'm open to suggestions though.
Well, I can't think of a better solution. Are you going to implement it yourself, or can I take it?
Go for it!
@futurechan I'm sorry, I've been busy these days and I can't find some time to implement these features. Can you do that?
@danilo-valente no worries. I've been slammed lately too. I'll try to get to it.
AT will throw a
TypeError: undefined is not a function
when none of tagTemplate and tag are not defined and the block is missing the filename: