-
Notifications
You must be signed in to change notification settings - Fork 512
Return an array of loader objects from extract() #343
Conversation
You need to sign the CLA. Apart from that, big 👍 from me. |
@insin Go for it. I just did not know if my changes did break someting |
Current coverage is 86.40% (diff: 100%)@@ 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
|
@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! |
There was a problem hiding this 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
@TheLarkInn Added some unit tests for the current implementation and tweaked it slightly to use/support Are there other use cases which 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? |
Really waiting for this PR to be merged 👍 |
Thanks @insin - This will be in |
As per webpack-contrib/extract-text-webpack-plugin#343 the .extract() method of ExtractTextPlugin has a return type of 'Loader[]'
This allows you to
use:
the output ofextract()
by not munging everything into a string (whichuse
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 withLoaderOptionsPlugin
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.