angular2 app 在执行 uglify 之后无法识别 routerLink、ngIf、ngFor 等指令

angular2 app 在执行 uglify 之后提示 template error。
在不添加 uglifyjs 时,运行正常。

Unhandled Promise rejection: Template parse errors:
Can't bind to 'routerlink' since it isn't a known property of 'button'.

Can't bind to 'ngforOf' since it isn't a known property of 'tr'.

Can't bind to 'ngif' since it isn't a known property of 'h4'.

阅读 4k
1 个回答

html-loader 这里需要修改

{
    test: /\.html$/,
    loader: 'html?-minimize'
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进