-
Notifications
You must be signed in to change notification settings - Fork 512
feat: add option to merge files (options.merge
)
#636
Conversation
Codecov Report
@@ Coverage Diff @@
## master #636 +/- ##
==========================================
+ Coverage 87.41% 87.95% +0.53%
==========================================
Files 7 7
Lines 302 332 +30
Branches 68 73 +5
==========================================
+ Hits 264 292 +28
- Misses 36 38 +2
Partials 2 2
Continue to review full report at Codecov.
|
options.merge
)
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.
Thx the logic looks good so far, but needs tests an interface design triage
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "extract-text-webpack-plugin", | |||
"version": "3.0.0", | |||
"version": "3.1.0", |
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.
Please revert this as we have release management in place and will take care of that
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.
understood
src/index.js
Outdated
this.filesToMerge[mergeChunk.filename] = []; | ||
} | ||
this.filesToMerge[mergeChunk.filename].push(extractedChunk); | ||
preventOutput = preventOutput || (mergeChunk.preventOriginalOutput !== false); |
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.
Can we find a better name (less verbose) then preventOriginalOutput
=> prevent || original || preventOriginal || ?
?
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.
sure, I was thinking also about that :P
I will include the tests, but wanted to make sure it wasn't going to become a dropped feature :)
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.
😛 Well we definitely need to check for ordering issues && multi entry setups and it needs approval from other maintainers aswell. But the feature itself is a nice improvement imho
…ons.merge[].originals * Revert version number to 3.0.0 due to internal management * Renamed options.merge[].preventOriginalOutput to a shorter options.merge[].originals * Test added but breaking lol. Need to check generated file names * Added test, but can't debug it * Need to check merge.originals option * options.merge[].originals working now
… should output original files
Hello. It looks like test is passing now.
So, after just checking the logic, I made it work.
Anything to do? |
Could you post the e.g tracking issue or elaborate where/what isn't going to work? I use Does
I will take a look later
Ignore this for now as it is unrelated to ETWP or this PR in particular (it's a known |
|
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.
I want @sokra's take on this before it goes anywhere. Given this ( etwp ) is going away & being rolled back into Webpack, any feature added is one that has to be ported into Webpack.
My initial impression is conceptually, this is a bit murky, hard to sufficiently test & I guarantee people are going to have trouble with it. That said, if Tobias is okay with it conceptually then we can work through the implementation .
@danikaze - We are going to have to pass on this one. Even if there wasn't already a plugin published for this, the last thing etwp needs at this point is more complexity. This is already planned for retirement & the functionality rolled back into Webpack where it belongs, this particular use case may or may not be addressed at that time, it's not for me to say. |
I see. Bad luck then. |
@danikaze - If you feel there is enough demand for this particular plugin, we can discuss rolling it as a stand alone in contrib. Given the state of etwp, where it's going & the similarities with the |
@d3viant0ne sure. |
Implements #634
Current status: it's merging files properly but the map file is lost in the intermediate step.