Skip to content
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

fix(develop): add blank .css to ensure mini-css-extract-plugin always has something to extract #29681

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Feb 22, 2021

Description

This handle 2 issues:

  1. Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8000/commons.css".

When there is no css, we add commons.css link but we don't actually generate it, so we serve our index.html instead for that request, which cause warning as above + generally is wonky

  1. In develop when you remove "last" .css import - the styles stay behind, because commons.css is not "regenerated" but it continue to exist in webpack-dev-middleware in-memory filesystem. Having that blank .css import actually ensure that when user removes their last .css commons.css updates (to empty file), meaning that we don't leave stale styles behind

Related Issues

[ch25434]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 22, 2021
@pieh pieh added topic: webpack/babel Webpack or babel and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 22, 2021
@wardpeet wardpeet merged commit 5de8562 into master Feb 22, 2021
@wardpeet wardpeet deleted the v3/once-upon-time-there-was-no-css branch February 22, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: webpack/babel Webpack or babel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants