Asset emission reworking#30
Merged
guybedford merged 20 commits intomasterfrom May 15, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
+ Coverage 70.3% 72.34% +2.04%
==========================================
Files 10 10
Lines 899 1034 +135
==========================================
+ Hits 632 748 +116
- Misses 267 286 +19
Continue to review full report at Codecov.
|
Contributor
Author
|
ncc tests are passing against this PR. Merging for a beta release to gain further feedback. |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR represents a reworking of the asset emission algorithm including:
requireandrequire.resolve. As a result many previously non-working dynamic require cases should now work out correctly.The exact emission logic is described below:
process.cwd
The
path.resolveandprocess.cwd()analysis will use theprocess.cwdof the build process itself. So if the build is run from the wrong directory these can not work out and cause assets not to be emitted.To support a custom
cwd, this can be passed as an option as well.require.resolve
__non_webpack_require__.resolve.require
__non_webpack_require__.requirecalls fallback to outer (like we did previously).variable declarations and assignments
call expressions
This PR should now resolve the following issues on ncc core:
__dirnamewhen importing files dynamically ncc#216__dirnamewhen importing files dynamically ncc#216__dirnamewildcards ncc#297Just a few ncc bugs left before this should be ready for further review and merging.