I've been having the issue, that as soon as I set
{ mode: 'production' }
in my webpack.config.js
my Angular templates that have been declared using
@Component({ templateUrl: 'path/to/template.html' })
could not longer be compiled.
The resulting errors were all related to directives used in the template, e.g.
src/path/to/template.html:1:123 - error NG8002: Can't bind to 'routerlink' since it isn't a known property of 'a'