question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation is confusing

See original GitHub issue

This plugin looks like it might be really amazing, but I am finding the documentation very confusing. It’s got lots of webpack config examples, but no examples of other files (e.g. JS, HTML). There are a few things that I cannot figure out:

  1. Is this plugin supposed to insert the styles into the HTML automatically like style-loader does? The documentation makes it seems like it’s supposed to, but from testing it doesn’t appear to.
  2. Should we be using style-loader at all with this plugin? I think the answer is no?
  3. How do you avoid a FOUC when using this plugin? Can we just add a <link rel='stylesheet' href='/build/main.css' />? Or do we have to add this in some circumstances but not others?
  4. Is HMR enabled by default or do I have to specify options: { hmr: true } to enable it?
  5. Is it necessary to configure this plugin differently between development and production or is that taken care of automatically?

From what I can work out it seems like you just add <link rel='stylesheet' href='/build/main.css' /> to the HTML, enable HMR for this plugin by passing options: { hmr: NODE_ENV == 'development' } and then everything works correctly in both development and production. If that’s so, this is absolutely fantastic! But you should really update the documentation to make this much more obvious. Currently it makes it look really complicated like you might still have to juggle multiple configs and mess with style-loader and maybe add <link> sometimes but not others. If it’s really as straightforward as I’m hoping, the documentation should be really cut down and start with the minimum working development/production example with HMR (but include HTML and JS code in the example).

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

3reactions
ScriptedAlchemycommented, Apr 30, 2020

I maintain both. Extract css chunks merged into mini css over a year ago. You can use either one. Modern features come to extract css before they go to mini css. Other than that. They remain the same internally because I pull request code from here to there. Feel free to use either, they look the same because I code new features on this one. Then merge them to mini css 😃

0reactions
Airkrocommented, Apr 30, 2020

Sorry, but what is become mean? Should I stop using extract-css-chunks-webpack-plugin ? I’m confirming whether I can migrate into mini-css-extract-plugin painlessly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the documentation so confusing? · Issue #7 - GitHub
I had been trying to "install" this corpus as suggested from the MLDoc task on the LASER page and I can't understand the...
Read more >
Why is documentation so hard to read sometimes? - Quora
The answer is that the company that produces the product made a business decision to skimp on producing the documentation. They didn't use...
Read more >
Why is documentation so difficult to read as a beginner? - Reddit
I found that docs can honestly be very high level. But learning more and working more on code allowed me to understand the...
Read more >
Confusing documentation - Microsoft Community
Trying to customize the task bar So which one of these two is correct?
Read more >
Suffering from Version Confusion? 5 Simple Ways to Be Better ...
Suffering from Version Confusion? 5 Simple Ways to Be Better at Documentation · 1. Store documentation on a cloud-based software · 2. Set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found