Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

asnowwolf
Copy link

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.

Copy link
Member

@clydin clydin left a 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
Copy link
Member

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,
Copy link
Member

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.

@asnowwolf
Copy link
Author

@clydin Great! It's truly a more graceful solution. Feel free to close this PR please.

@clydin
Copy link
Member

clydin commented Nov 3, 2017

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.

@clydin
Copy link
Member

clydin commented Dec 14, 2017

Superseded by #8883

@clydin clydin closed this Dec 14, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants