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

fix: don't extract from common async chunks #508

Merged
merged 1 commit into from Jun 8, 2017
Merged

fix: don't extract from common async chunks #508

merged 1 commit into from Jun 8, 2017

Conversation

numical
Copy link
Contributor

@numical numical commented May 18, 2017

The problem

  1. Create an entry point requiring two asynchronous chunks;
  2. Name these asynchronous chunks;
  3. Configure CommonsChunkPlugin to generate a common chunk explicitly for these two asynchronous chunks;
  4. If the resultant commons chunk has embedded CSS, ExtractTextPlugin does not extract this.

See the added test case in this PR for the scenario.

This may be related to issues 120 and 459.

The cause
The generated async chunk has no parents and no entry point.

The fix
Replace all uses of chunk.isInitial() with chunk.isInitial() || chunk.parents.length === 0.

@codecov
Copy link

codecov bot commented May 18, 2017

Codecov Report

Merging #508 into master will increase coverage by 0.05%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #508      +/-   ##
==========================================
+ Coverage   90.38%   90.43%   +0.05%     
==========================================
  Files           6        6              
  Lines         364      366       +2     
  Branches       77       78       +1     
==========================================
+ Hits          329      331       +2     
  Misses         35       35
Impacted Files Coverage Δ
index.js 91.11% <85.71%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 58dd5d3...2bc32f8. Read the comment docs.

@michael-ciniawsky michael-ciniawsky changed the title fix not extracting CSS from common async chunks fix: don't extract CSS from common async chunks Jun 8, 2017
@joshwiens joshwiens changed the title fix: don't extract CSS from common async chunks fix: Do not extract CSS from common async chunks Jun 8, 2017
@michael-ciniawsky michael-ciniawsky changed the title fix: Do not extract CSS from common async chunks fix: don't extract from common async chunks Jun 8, 2017
@michael-ciniawsky
Copy link
Member

Fixes #120 #453

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants