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

docs(README): add extract-loader example #518

Merged

Conversation

mareksuscak
Copy link
Contributor

Recently needed this and I think it’s worth documenting for other folks. Took me a few days to figure out.

The difference between to-string-loader and extract-loader is that former wraps the CSS in a JS module while latter executes the css-loader’s output at compile time and passes that to the next loader in the chain. Came in handy when we needed some further post processing.

@jsf-clabot
Copy link

jsf-clabot commented Apr 25, 2017

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 25, 2017

Codecov Report

Merging #518 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #518   +/-   ##
======================================
  Coverage    98.6%   98.6%           
======================================
  Files          10      10           
  Lines         359     359           
  Branches       81      81           
======================================
  Hits          354     354           
  Misses          5       5

Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mareksuscak This is eventually is better placed in Examples #extract ? But it also has connections to toString() and Angular usage, so not 💯 where to place it at best tbh 😛

README.md Outdated
@@ -73,6 +73,10 @@ console.log(css); // {String}

If there are SourceMaps, they will also be included in the result string.

If, for one reason or another, you need to extract CSS as a
plain string resource (i.e. not wrapped in a JS module) you
might want to check out the [extract-loader](https://github.com/peerigon/extract-loader). It's useful when you, for instance, need to post-process the CSS as a string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\n after the extract-loader link aswell for consistency? [link].\n It ....

post-process => post process

Copy link
Member

@michael-ciniawsky michael-ciniawsky Apr 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An small setup example would be appreciated aswell :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool will do, thanks for reviewing!

@michael-ciniawsky michael-ciniawsky self-assigned this Apr 25, 2017
@michael-ciniawsky michael-ciniawsky changed the title Document extract-loader. docs(README): add extract-loader example Apr 25, 2017
Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-ciniawsky michael-ciniawsky merged commit 760eefa into webpack-contrib:master Apr 26, 2017
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.

3 participants