Closed eromoe closed 6 years ago
Hi,
I faced a problem while using https://github.com/material-components/material-components-web/
@import "material-components-web/material-components-web"; got error:
@import "material-components-web/material-components-web";
File to import not found or unreadable: material-components-web/material-components-web ....
resolve-url-loader
{ test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader!resolve-url-loader!sass-loader?sourceMap', },
includePaths
sass-loader
{ test: /\.scss$/, loaders: [ 'style-loader', 'css-loader', { loader: 'sass-loader', options: { sourceMap: true, includePaths: [path.resolve(process.cwd(), 'node_modules')], }, }, ], }
I am using react-boilerplate https://github.com/react-boilerplate/react-boilerplate to build project.
node_modules is in same directory as app .
node_modules
app
I guess it is due to webpack.config.js is not in root dir ? Is there any way make resolve-url-loader compatible to this situation ?
webpack.config.js
@eromoe In general you will need tilde ~ to get imports in SASS. However I am not sure if this "not in root dir" structure will give you further issues.
~
Closing this due to inactivity.
Hi,
I faced a problem while using https://github.com/material-components/material-components-web/
@import "material-components-web/material-components-web";
got error:Add
resolve-url-loader
not work, config like below:I solved this error by assign
includePaths
insass-loader
Folder structure:
I am using react-boilerplate https://github.com/react-boilerplate/react-boilerplate to build project.
node_modules
is in same directory asapp
.I guess it is due to
webpack.config.js
is not in root dir ? Is there any way makeresolve-url-loader
compatible to this situation ?