Ctrl+click (go to file) doesn't work for saas-loader ~ imports (node_modules)
See original GitHub issueTrying to Ctrl+click on the imported module name fails:
@import '~bootstrap/scss/bootstrap';
with this error:
Unable to open '_bootstrap.scss': File not found (file:///PROJECT/src/styles/~bootstrap/scss/_bootstrap.scss).
The reason is that I’m using webpack
with saas-loader
, and saas-loader
treats an import path starting with ~
as an import from node_modules
: https://github.com/webpack-contrib/sass-loader#imports
So the actual location from where the import should be loaded is:
file:///PROJECT/node_modules/bootstrap/scss/_bootstrap.scss
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Sass-loader not resolving import correctly if other type file ...
scss while resolving imports from main.scss. If I assign the unique name to foo.scss file, it will work fine. Above is the essence...
Read more >SCSS import paths cannot be resolved
i have a very annoying issue with the import paths in my scss. We are using grunt-sass for compiling several scss files, setting...
Read more >Sass · Bootstrap v5.0
Utilize our source Sass files to take advantage of variables, maps, mixins, and functions to help you build faster and customize your project....
Read more >A mostly complete guide to webpack 5 (2020)
A mostly complete guide to webpack's capabilities, always to keep close at hand.
Read more >Hot Module Replacement - webpack
Now let's update the index.js file so that when a change inside print.js is detected we tell ... If you go ahead and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@penx @aeschli when you prefix your path with
~
, webpack not only searches for the file inside thenode_modules
directory, but also considers aliases defined usingwebpack.config.js
.This behavior has already been taken into account for JS - you can tell IntelliSense about your aliases using jsconfig. Would it be possible to e.g. retrieve that information for *.scss files?
try vs code CSS Navigation