Answer the question
In order to leave comments, you need to log in
Error importing css.style 'webpack', couldn't fix what's wrong in the config?
Please help me, I can't solve the problem for the fourth hour already.
I import the css file into the /src/app.js module, I get an error when building
webpack version 1
Structure:
src/
js/
app.js
assets/
css/
main.css
webpack.config.js:
https://codepen.io/PolyakhAlex/ pen/yzyQLv
package.json
https://codepen.io/PolyakhAlex/pen/WZbYeO
Error:
ERROR in ./assets/css/main.css
Module not found: Error: Cannot resolve 'file' or 'directory' ../ ../../node_modules/css-loader/index.js in C:\Users\Polyakh\Desktop\Webpack/src\assets\css
@ ./assets/css/main.css 4:14-155
More verbose error 'webpack --display-error-details':
ERROR in ./assets/css/main.css
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../node_modules /css-loader/index.js in C:\Users\Polyakh\Desktop\Webpack/src\assets\css
resolve file
C:\Users\Polyakh\Desktop\node_modules\css-loader\index.js doesn't exist
C :\Users\Polyakh\Desktop\node_modules\css-loader\index.js.js doesn't exist
resolve directory
C:\Users\Polyakh\Desktop\node_modules\css-loader\index.js doesn't exist (directory default file)
C:\Users\Polyakh\Desktop\node_modules\css-loader\index.js\package.json doesn't exist (directory description file)
[C:\Users\Polyakh\Desktop\node_modules\css-loader\index .js]
[C:\Users\Polyakh\Desktop\node_modules\css-loader\index.js.js]
@ ./assets/css/main.css 4:14-155
ERROR in ./assets/css/main.css
Module not found: Error: Cannot resolve 'file' or 'directory' ../../../node_modules/style-loader/lib/addStyles.js in C:\Users\Polyakh\Desktop\Webpack/src\assets\c
ss
resolve file
C:\Users\Polyakh\Desktop\node_modules\style-loader\lib\addStyles.js doesn't exist
C:\Users\Polyakh\Desktop\node_modules\style-loader\lib\addStyles.js.js doesn't 't exist
resolve directory
C:\Users\Polyakh\Desktop\node_modules\style-loader\lib\addStyles.js doesn't exist (directory default file)
C:\Users\Polyakh\Desktop\node_modules\style-loader\lib\addStyles.js\package.json doesn't exist (directory description file)
[C:\Users\Polyakh\Desktop\node_modules\style-loader\lib \addStyles.js]
[C:\Users\Polyakh\Desktop\node_modules\style-loader\lib\addStyles.js.js]
@ ./assets/css/main.css 12:13-76
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question