Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that any __non_webpack_require__ is retained in subsequent builds #271

Merged
merged 1 commit into from
Feb 4, 2019

Conversation

guybedford
Copy link
Contributor

This is an interesting one, basically when an ncc build is again built, any instances of the following pattern:

const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;

will be converted into:

const requireFunc = false ? require : undefined;

by Webpack. And as a result the pattern breaks on the second build.

Fixed by injecting a phase before that avoids this double rewriting.

//cc @sokra this seems to be a breakdown in build transitivity in Webpack.

@codecov-io
Copy link

Codecov Report

Merging #271 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
+ Coverage   74.91%   75.08%   +0.16%     
==========================================
  Files          17       17              
  Lines         909      915       +6     
==========================================
+ Hits          681      687       +6     
  Misses        228      228
Impacted Files Coverage Δ
src/loaders/relocate-loader.js 97.36% <100%> (+0.06%) ⬆️

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 60b5729...b821d66. Read the comment docs.

@rauchg rauchg merged commit 82336fa into master Feb 4, 2019
@rauchg rauchg deleted the require_check_retain branch February 4, 2019 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants