fix: don't attempt to change declarationMap sources when no output#334
Merged
ezolenko merged 1 commit intoezolenko:masterfrom Jun 1, 2022
Merged
fix: don't attempt to change declarationMap sources when no output#334ezolenko merged 1 commit intoezolenko:masterfrom
sources when no output#334ezolenko merged 1 commit intoezolenko:masterfrom
Conversation
- when using rpt2 as a configPlugin, there is no Rollup `output`, so it
will be `undefined`
- when `declarationMap: true` in `tsconfig`, this block of code is
called as a workaround due to the placeholder dir we must use for
output -- but, in this case, it errors out, since the
`declarationDir` is `undefined`
- `path.relative` needs a `string` as a arg, not `undefined`
- so skip this transformation entirely when there's no `output`, as
it doesn't need to be done in that case anyway
- this transformation code happens to have been written by me 2
years ago too, so I had fixed one bug with that but created
a different bug 😅 (fortunately one that only I have stumbled upon)
8448f32 to
3a9c951
Compare
Collaborator
Author
1 task
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.
Summary
Skip transforming declarationMap
sourceswhen there is no output, i.e. in the case of using rpt2 as aconfigPluginconfigPluginwith"declarationMap": true#310Details
configPlugin, there is no Rollupoutput, so it will beundefineddeclarationMap: trueintsconfig, this block of code is called as a workaround due to theplaceholderdir we must use for output -- but, in this case, it errors out, since thedeclarationDirisundefinedpath.relativeneeds astringas a arg, notundefinedoutput, as it doesn't need to be done in that case anyway