We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i use extract-loader and css-loader to generate source map, but the sourceURL always prepend aundefined
extract-loader
css-loader
sourceURL
undefined
body{color:red}body a{color:#fff}body.open{background-color:#fef} /*# sourceURL=undefined/src/index.scss */ ...
I found that sourceRoot does not necessarily exist, sometimes it equals undefined.
sourceRoot
I look for some codes, and found that https://github.com/peerigon/extract-loader/blob/master/src/extractLoader.js#L141, it uses extractExports function to transform, (Function toString()) sandbox.module.exports; And the css-loader (webpack-contrib/css-loader#674 (comment)) use cssWithMappingToString and the variables cssMapping.sourceRoot to concat string, but https://github.com/webpack-contrib/css-loader/blob/master/src/index.js#L76 has been remove the sourceRoot, so that extract-loader can not found sourceRoot anymore, and sourceRoot always to undefined
extractExports
Function toString()
sandbox.module.exports
cssWithMappingToString
cssMapping.sourceRoot
I suggest extract-loader can compatibles it, when the sourceRoot is undefined
My package.jsonand webpack config below:
package.json
webpack config
// package.json { "extract-loader": "^3.1.0", "css-loader": "^3.4.0", }
// webpack config { loader: 'extract-loader' }, { loader: 'css-loader', options: { sourceMap: true } }, { loader: 'sass-loader', options: { sourceMap: true, sassOptions: { sourceMapRoot: '/' } } }
The text was updated successfully, but these errors were encountered:
Report wrong place, i have been forward to css-loader... webpack-contrib/css-loader#1034
Sorry, something went wrong.
No branches or pull requests
Issue
i use
extract-loader
andcss-loader
to generate source map, but thesourceURL
always prepend aundefined
Reason
I found that
sourceRoot
does not necessarily exist, sometimes it equalsundefined
.I look for some codes, and found that https://github.com/peerigon/extract-loader/blob/master/src/extractLoader.js#L141, it uses
extractExports
function to transform, (Function toString()
)sandbox.module.exports
; And thecss-loader
(webpack-contrib/css-loader#674 (comment)) usecssWithMappingToString
and the variablescssMapping.sourceRoot
to concat string, but https://github.com/webpack-contrib/css-loader/blob/master/src/index.js#L76 has been remove the sourceRoot, so thatextract-loader
can not foundsourceRoot
anymore, andsourceRoot
always toundefined
Suggest
I suggest
extract-loader
can compatibles it, when thesourceRoot
is undefinedEnvironment
My
package.json
andwebpack config
below:The text was updated successfully, but these errors were encountered: