Working with component css files in workspaces in chrome with angular cli 6 project
Asked Answered
B

1

8

I'm trying to use Google Chrome workspaces with CSS persistent editing in an Angular 6/7 CLI project.

When adding "extractCSS:true" in angular.json configuration and using "--source-map=true" flag I can see the CSS file in the "sources" and "elements" tabs in Chrome, and I can map it to the online CSS file, but when changing the style in the "elements" panel the change is not persistent and is not saved to the file.

Is it possible to edit the component CSS files from within Chrome dev tools with workspaces (without ejecting the app) ?

  • In the following GIF you can see that although the little green dot near the file name is on, indicating that the map between the network resource and the local file has been established, the changes from the elements panel are not reflected in the file:

changes are not saved to file

Bani answered 21/11, 2018 at 12:30 Comment(0)
F
6

@Kayce Basques, the technical writer of Chrome DevTools commented on a question similar to this one, saying:

DevTools technical writer here. The workflow that benshabatnoam posted is the best we've got. Set up a Workspace and then edit your files from the Sources panel. Editing from Elements panel > Styles pane works on basic projects, but has trouble with frameworks (such as Angular) that use sourcemaps and do a lot of build transformations. Sucks, I know, but I recall that we've looked into it in-depth and our hands are tied until sourcemap usage is standardized.

Unfortenatly the answer to your question is NO, we can't (as for today) edit the component CSS files from within Chrome dev tools with workspaces :(

Fireworm answered 24/12, 2018 at 20:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.