← 输入框|github.com|刷新
Skip to content

fix(build): Don't specify the extract-css option as precondition for css sourcemaps - #8294

Closed
asnowwolf wants to merge 1 commit into
angular:masterfrom
asnowwolf:css-source-maps
Closed

asnowwolf wants to merge 1 commit into
angular:masterfrom
asnowwolf:css-source-maps

Conversation

@asnowwolf

Copy link
Copy Markdown

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.

@clydin clydin left a comment

Copy link
Copy Markdown
Member

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/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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Author

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

@clydin

clydin commented Nov 3, 2017

Copy link
Copy Markdown
Member

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

clydin commented Dec 14, 2017

Copy link
Copy Markdown
Member

Superseded by #8883

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

Copy link
Copy Markdown

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