For anyone on teh Google's I had much better luck with the stringify transform.
https://github.com/JohnPostlethwait/stringify
The answers here were frustrating (though not unwelcome) I'm importing templates as strings into my components to save on the HTTP requests bought about by templateUrl
and keep them out of the Javascript files.
For some reason brfs
does not play nicely with babel and has a lot of caveats to get working at all.
I couldn't get browserify-fs
to work at all.
However, after finding the stringify
transform it was as simple as.
import template from '../template.html'
const definition = { template }
component.directive('myDirective', () => definition)
Translated for ES5 users:
var template = require('../template.html')
component.directive('myDirective', function() {
return {
template: template
}
})