How to Source Map Angular CLI css files in Chrome Dev Tools?

本小妞迷上赌 提交于 2019-11-28 08:14:48
ggedde

Angular-cli uses webpack, but it comes with its own configuration files in /node_modules/angular-cli/models.

You can modify them, but if you upgrade angular-cli it will overwrite your files. So make sure to back them up.

Yes, it is meant to go inline <style> tags. I agree that this seems weird and should be in a separate file, mainly so it can be cached by the user and reduce your views chunk size. It might be that they think inline is good as when you're in development mode you don't want it cached, which is fine, but on 'ng build' it should be compiled to its own file.

I know you can configure webpack to do that using the "extract-text-webpack-plugin", but I am not too familiar with it.

I would like to see angular-cli do that on build or have an option in the configuration for that.

Serhiy Koziuk

When you type ng serve by default angular cli doesn't include sourcemaps files for css files but you can include it by typing this command

ng serve -sm -ec

or

ng serve --sourcemap --extractCss

I use Angular Cli -v 1.0.3, and More information - Angular CLI special cases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!