[bug?] Webpack aliases being ignored.
See original GitHub issueI have an alias like this in webpack.config.js:
'common': path.resolve(__dirname, '..', '..', 'common'),
and I have import statements like these in my .scss
files:
@import "common/scss/colors";
but it doesn’t work.
If I change it to
@import "../../common/scss/colors";
just like what the Webpack alias defines, then it works!
I can work around the problem by making my own loader, and modifying the @imports
to have the unaliased strings, but that’s obviously not desirable.
Possibly related: https://github.com/webpack-contrib/sass-loader/issues/173
Issue Analytics
- State:
- Created 7 years ago
- Reactions:18
- Comments:24 (3 by maintainers)
Top Results From Across the Web
Webpack alias is being ignored when module present
I'm aliasing the react-native module as react-native-web like this: webpackConfig.resolve.alias["react-native$ ...
Read more >Resolve | webpack
Setting resolve.alias to false will tell webpack to ignore a module. module.exports = { //.
Read more >jsconfig.json Reference - Visual Studio Code
Using webpack aliases. For IntelliSense to work with webpack aliases, you need to specify the paths keys with a glob pattern. For example,...
Read more >Webpack aliases not resolved when using ... - YouTrack
Webstorm is not resolving the modules even though I have explicitely declared such file as the "webpack configration file" inside the Settings panel....
Read more >How to Use Webpack's Module Aliasing - Mastering JS
Aliasing is webpack's handy way to shave time and keystrokes off importing frequently used modules. You will need the path module, ...
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 Free
Top 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
+1 same issue, webpack 2
Guys, have you seen this link? 😃 https://getbootstrap.com/docs/4.0/getting-started/webpack/#importing-javascript