There is the inlineText
build config option (true by default) which instructs the optimizer to do exactly what you want. One caveat is that it will, just like with any other module, only detect dependencies specified in some module's define()
block. In other words, it won't be able to detect text!
dependencies which are requested on demand, unless they're made reachable explicitly - and this is where your problem lies.
One workaround (far from ideal if you have many view files) would be to specify every single text!
dependency you use in the include
option inside your build config, e.g.:
// ...
include: ["text!views/primaryapplicants.html",
"text!views/secondaryapplicants.html",
// etc.
]
// ...