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: ensures cssReload is called on first import #726

Closed
wants to merge 1 commit into from
Closed

fix: ensures cssReload is called on first import #726

wants to merge 1 commit into from

Conversation

ferdinando-ferreira
Copy link

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Hot module reload was never called on the first inclusion of a css file.

Breaking Changes

None

Additional Info

Fixes #706.

These are the steps to reproduce both the issue and the solution

Testing the problem

git clone https://github.com/ferdinando-ferreira/mini-css-extract-plugin-new-css-import.git --single-branch mini-css-extract-plugin-new-css-import
cd mini-css-extract-plugin-new-css-import
npm install

To test the problem, run

npm run start

The browser will open on localhost:8080. Then open `index.js´ and remove the comment from the following line

// import "./second.css";
  • Expected result: font size of foo will increase to 48px
  • Actual result: it doesn't

Testing the solution

To test the solution, restore `index.js* to the original state, and run

npm run start:fixed

The browser will open on localhost:8080. Then open `index.js´ and remove the comment from the following line

// import "./second.css";
  • Expected result: font size of foo will increase to 48px
  • Actual result: works as expected

@ferdinando-ferreira
Copy link
Author

Caveat: cssReload() is called unnecessarily on first execution.

Considering it has no actual impact that could be a "lesser" bug than the original one (not being called on new import), one that I can fix given enough time and strictly if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding new css import doesn't result in hot style update
1 participant