Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Return an array of loader objects from extract() #343

Merged
merged 2 commits into from
Jan 26, 2017
Merged

Return an array of loader objects from extract() #343

merged 2 commits into from
Jan 26, 2017

Conversation

insin
Copy link
Contributor

@insin insin commented Jan 19, 2017

This allows you to use: the output of extract() by not munging everything into a string (which use config should obviate the need for in Webpack 2).

It's far less surprising and makes it possible to provide plugins to preprocessor loaders directly via loader options instead of messing around with LoaderOptionsPlugin

This change is as per tmair/extract-text-webpack-plugin@1414036 - if @tmair wants to create their own PR for it, I'm happy to close this one.

@jsf-clabot
Copy link

jsf-clabot commented Jan 19, 2017

CLA assistant check
All committers have signed the CLA.

@bebraw
Copy link
Contributor

bebraw commented Jan 19, 2017

You need to sign the CLA. Apart from that, big 👍 from me.

@tmair
Copy link

tmair commented Jan 19, 2017

@insin Go for it. I just did not know if my changes did break someting

@tmair
Copy link

tmair commented Jan 22, 2017

@insin Travis is failing because of an old node version. If you rebase your canges to the current master the isse should be gone (See #335)

@codecov-io
Copy link

codecov-io commented Jan 23, 2017

Current coverage is 86.40% (diff: 100%)

Merging #343 into master will increase coverage by 0.26%

@@             master       #343   diff @@
==========================================
  Files             4          4          
  Lines           332        331     -1   
  Methods          68         68          
  Messages          0          0          
  Branches         71         69     -2   
==========================================
  Hits            286        286          
+ Misses           46         45     -1   
  Partials          0          0          

Powered by Codecov. Last update c8494f3...e2f8fd8

@bebraw bebraw added this to the Webpack 2 release milestone Jan 23, 2017
@khankuan
Copy link

@insin thanks for the fix. Hopefully it can be rebased and merge soon. That's the main blocker I've found migrating to webpack2. Thanks!

Copy link

@TheLarkInn TheLarkInn left a comment

Choose a reason for hiding this comment

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

A test would be a good addition to this PR.

Use "options" for own loader options
Also use "options" as a check for loader being specified as a loader object
@insin
Copy link
Contributor Author

insin commented Jan 24, 2017

@TheLarkInn Added some unit tests for the current implementation and tweaked it slightly to use/support options.

Are there other use cases which extract() should support?

e.g. if you specify a loader as a string with query params, is it ok that it will be now passed straight through as-is, or is that something for Webpack itself to worry about?

@jakwuh
Copy link

jakwuh commented Jan 25, 2017

Really waiting for this PR to be merged 👍

@joshwiens
Copy link
Member

Thanks @insin - This will be in 2.0.0-rc.0 which will be published in short order

@insin insin deleted the extract-array branch January 26, 2017 12:07
nhardy added a commit to nhardy/DefinitelyTyped that referenced this pull request May 19, 2017
As per webpack-contrib/extract-text-webpack-plugin#343 the .extract() method of ExtractTextPlugin has a return type of 'Loader[]'
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.

9 participants