Resolve ts-invariant/process
module identifier again in config/resolveModuleIds.ts
#9083
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.
From
@apollo/[email protected]
until my recent PR #9073 (v3.5.3), non-relative imported module identifiers likets-invariant/process
were rewritten during the build process (duringnpm run resolve
) to include a specific module with a file extension (not a directory), producing in this examplets-invariant/process/index.js
.That rewriting was the wrong choice in general (for example, it would rewrite
graphql
tographql/index.mjs
), so PR #9073 disabled the rewriting for all non-relative imports.However, the specific replacement of
ts-invariant/process
withts-invariant/process/index.js
is still useful to prevent the strange webpack 5-specific errorwhich apparently happens because the
resolve.fullySpecified
option istrue
by default now. App developers could configureresolve.fullySpecified
explicitlyfalse
, but we (the Apollo Client team) prefer a general workaround.In other words, this PR refines the changes from #9073 to reenable one specific non-relative module rewriting (the same module mentioned in the commit message 60e18e9,
ts-invariant/process
).