Open ghost opened 8 years ago
Maybe there is some workaround, which will allow use of templates without require
? Please don't suggest just to turn commonJS wrappers off for whole project. This is not a solution.
It's been a while since I used this. The way I remember doing so is I had my templates in a joinTo
, using some regex, so I did not have the repetition that you describe. Is that what you mean by not using commonJS?
Brunch have an ability to turn off CommonJS wrappers so all of your code wil be concatenated as is. Of course in this case will appear issues with concatenation order so i really want to use default modular approach. The thing with your plugin is that every template become CommonJS module and you need to explicitly require them. Not a big deal but for now it is just inconvinent.
I think that all we need is just loader for HTML, because then we can just template: require('./template.html')
When i use brunch with your plugin i end up with code like this:
which is horrible.
templateUrl: require('template/path/with.ext')
will be very nice.