-
-
Notifications
You must be signed in to change notification settings - Fork 608
Closed
Description
Module not found: Error: Can't resolve '~'
What is the current behavior?
Using a tilde ~ inside a css file causes Can't resolve '~' if css-modules feature is activated:
{
loader: 'css-loader',
options: {
modules: true,
}
},If the current behavior is a bug, please provide the steps to reproduce.
The bug can be reproduced this way: (https://github.com/jantimon/css-loader-bug)
git clone https://github.com/jantimon/css-loader-bug.git
cd css-loader-bug
npm install
npm run without-modules
npm run with-modulesWorking webpack.config.js
Broken webpack.config.js
CSS File
What is the expected behavior?
Compilation should work even if modules are set to true.
Motivation
I wrote a loader which adds ~!! to a css file and it does not know if the user is using css-modules: https://github.com/jantimon/iconfont-webpack-plugin/blob/master/lib/postcss-plugin.js#L135-L137
thescientist13, lhnrd, chbdetta, kohver, nickspiel and 7 more