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

Use the local TypeScript version when applicable #233

Merged
merged 3 commits into from
Jan 18, 2019
Merged

Use the local TypeScript version when applicable #233

merged 3 commits into from
Jan 18, 2019

Conversation

guybedford
Copy link
Contributor

This also refactors the way that dynamic requires are handled by ensuring that require(nonAnalyzableExpression) will always defer to the __non_webpack_require__. This also allows us to remove the previous hack of the "Not found" context in Webpack doing a fallback to the environment require.

The internal loader loads are then altered to use a non-analyzable require to load dynamically in production. Note that this is the sort of feature code splitting would allow us to avoid as it would work naturally with the types of optimizations involved. So that it looks like a hack is simply because we aren't taking advantage of code splitting which would allow it not to be a hack (as in the whole ncc project would be one build as opposed to many then).

This is based to #232 which turned out to be quite a rabbit hole. This can be merged and that one closed as a result.

@codecov-io
Copy link

codecov-io commented Jan 17, 2019

Codecov Report

Merging #233 into master will decrease coverage by 0.46%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
- Coverage      70%   69.53%   -0.47%     
==========================================
  Files          13       14       +1     
  Lines         670      663       -7     
==========================================
- Hits          469      461       -8     
- Misses        201      202       +1
Impacted Files Coverage Δ
src/index.js 70.96% <100%> (-1.13%) ⬇️
src/loaders/relocate-loader.js 92.85% <100%> (-0.07%) ⬇️
src/typescript/index.js 100% <100%> (ø)
src/loaders/ts-loader.js 88.88% <0%> (-5.56%) ⬇️

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 5b54d32...30d7f42. Read the comment docs.

@mikaelbr
Copy link

Think this might have introduced an issue (related #237) which also breaks typescript support for Now.sh with @now/node@canary. Sorry I haven't dug deep enough to find what is causing it.

@mikaelbr
Copy link

Hypothesized a fix here after a limited analysis, but not on my pc to do proper debugging and verification: #237 (comment)

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.

4 participants