unable to generate sourcemap for sass with asset/resource #13505
-
Thank you for webpack, it's awesome. My setup is successfully compiling sass/scss and outputting a What I'd really like is the equivalent of
which generates I have the following module rules in rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
// transpileOnly: true,
},
},
{
test: /\.s[ac]ss$/i,
type: 'asset/resource',
generator: {
filename: 'assets/[name].css[query]',
},
use: [
{
loader: 'sass-loader',
options: {
sourceMap: true,
sassOptions: {
outputStyle: 'expanded',
},
},
},
],
},
{
test: /\.(css|png|ico|jpe?g|svg|woff2?|ttf)$/i,
type: 'asset/resource',
},
], I I know that the and the map is present and populated. However I've tried numerous values of Is this a limitation of Notable dependency version: "css-loader": "^5.2.6",
"sass": "^1.34.1",
"sass-loader": "^12.0.0",
"style-loader": "^2.0.0",
"ts-loader": "^9.2.2",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Please pass these options https://sass-lang.com/documentation/js-api#sourcemap to |
Beta Was this translation helpful? Give feedback.
Please pass these options https://sass-lang.com/documentation/js-api#sourcemap to
sassOptions
, notsourceMap
, thesourceMap
option for internal source maps (handled and extracted/inlined by webpack), but here you need external source maps (i.e. fromsass
), but I do not recommend do it