-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(build): Don't specify the extract-css option as precondition for css sourcemaps #8294
New issue
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
Conversation
93472b1
to
cb3701f
Compare
…on for css sourcemaps Instead, use `convertToAbsoluteUrls: true`. See <https://github.com/webpack-contrib/style-loader#converttoabsoluteurls>.
cb3701f
to
39631bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also requires a style-loader
version of at least 0.14.
Note also that the real fix for this would be the style-loader
PR webpack-contrib/style-loader#219 which uses a more modern method to inline the stylesheets.
@@ -39,7 +39,7 @@ export function getStylesConfig(wco: WebpackConfigOptions) { | |||
// style-loader does not support sourcemaps without absolute publicPath, so it's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this completely fixes the issue, then this comment should be removed.
use: buildOptions.extractCss ? ExtractTextPlugin.extract(extractTextPlugin) : [{ | ||
loader: 'style-loader', | ||
options: { | ||
convertToAbsoluteUrls: cssSourceMap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be needed. From looking at this code, the option is automatically enabled if the stylesheet has a source map and the setting is undefined.
@clydin Great! It's truly a more graceful solution. Feel free to close this PR please. |
This should provide a working solution until that PR is merged. With the changes mentioned above, the improvements from that PR (once merged and released) should automatically apply with no changes necessary on this end. |
Superseded by #8883 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Don't specify the extract-css option as precondition for css sourcemaps, Instead, use
convertToAbsoluteUrls: true
.See https://github.com/webpack-contrib/style-loader#converttoabsoluteurls.
P.S.
My english is not so good, feel free to edit the commit message. Thank you.