Webpack css-loader cannot find index.js, loader style cannot find addStyles.js

A mistake in. /app/index.scss Module not found: Error: Unable to resolve "file" or "directory". /../node_modules css-loader / index.js in C: \ Users \ johnliang \ Temp \ webpack- angular / app @. / app / index.scss 4: 14-116 13: 2-17: 4 14:20 -122

A mistake in. /app/index.scss Module not found: Error: Unable to resolve "file" or "directory". /../node_modules style-loader / addStyles.js in C: \ Users \ johnliang \ Temp \ webpack- angular / app @. / app / index.scss 7: 13-68

index.scss does not load into the final output of the web package.

+6
source share
1 answer

Make sure you use

path.join (__ dirname, 'src')

but not

__ dirname + '/ src'

in your webpack.config.js:

var path = require('path'); module.exports = { context: path.join(__dirname, 'src'), ... 
+21
source

Source: https://habr.com/ru/post/987307/


All Articles