Moving .scss files to other directories changes @import pathing to relative vs. project root

IDE: WebStorm 2020.3.2

Issue:

When I am refactoring Angular applications into modules, or refactoring in general. I will go to move an entire component (its directory) to another directory within the project window.

The "Move" dialog window comes up, and I hit REFACTOR.

Later, when I go to use the Git UI for committing files, I notice I have a lot of changes in .scss files, the only difference being the @import statements. I might expect that if I was using relative pathing to start with, but essentially it can go from something like:

@import 'src/palette'
to
@import '../../../../palette'

which is a bit less obvious where the import is really coming from.

Expected: @import 'src/palette' is left alone

What I've Tried:

* Looking up the topic online
* Trying to find the setting for something like this in Settings->Code Style->Style Sheets->SCSS and others
* Trying to see if a similar setting in Settings->Code Style->JavaScript or TypeScript->Imports have any effect (There is an option to "Use paths relative to the project, resource or sources roots), but they didn't
* Looking up the topic in these forums

It kind of looks like this has been implemented in the options above for JavaScript/TypeScript, just not for style sheets. Is there any other way to update this? Thank you~

3 comments
Comment actions Permalink

The issue is tracked at https://youtrack.jetbrains.com/issue/WEB-37434, please follow it for updates

0
Comment actions Permalink

Thank you for that Elena Pogorelova!

Ok so it looks like that issue is 2 years old and only has 1 vote now, including mine XD

So since that doesn't have any comments or any traction really at all, is there any workaround that we know of?

0
Comment actions Permalink

No workarounds I'm aware of unfortunately:(

0

Please sign in to leave a comment.