My project structure:
webpack.config.js
app--
--> src
---->> components
------>>> myComponent.js
------>>> myComponen
In my case the dependency is a node module, therefore I can import it like this:
@import '~node-module-name/variables';
And when using the actual node module dir name, my editor (PhpStorm) is not showing unresolved path error anymore (the problem which @tkiethanom mentioned). It looks like I need to specify alias in webpack config if I want to use sass style imports (e.g. my-package/colors
instead of my-package/_colors.scss
), and it seems it doesn't matter what is the name of that alias, as long as I use node module directory name