2 January 2023 13:26
I want to use scss style file, so I need to add sass-loader to webpack.config.js file, I have seen Can't add loaders to generated webpack.config.js · Issue #766 · eclipse-theia/theia · GitHub, I follow their way, but I get the following error
, How to fix this
my webpack.config.js file is
2 January 2023 14:43
the generated webpack config is an array, not an object. That’s why the merge function returns an object with the index
1 (which is the unknown property that webpack complains about). You should probably just fix it by wrapping the object that you put in the merge function into an array.
2 January 2023 22:36
Thank you for your replay,
I try add array like this
but get same error.
I try this
these two get same error
Do I do something wrong?
30 January 2023 18:23
Just now seeing your post. In case you still looking for an answer to the sass question, here’s a snippet of what my webpack.config.js looks like wrt sass support:
const config = require('./gen-webpack.config.js');
config.forEach(o => o.module.rules = [
use: ['extract-loader', 'css-loader', 'sass-loader']
4 March 2023 07:42
Sorry for late, thank you very much.
I execute yarn add -D sass-loader sass and use your config but change ‘extract-loader’ to ‘style-loader’. It works now