fix(types): correct Asset type definition from string literal to string union#3323
Merged
kamilmysliwiec merged 1 commit intoApr 8, 2026
Merged
Conversation
…ng union The `Asset` type was defined as `'string' | AssetEntry` (a literal string type matching only the word "string") instead of `string | AssetEntry` (any string). This typo has existed since the type was introduced in v6.10.0. Also updates `CompilerOptions.assets` from `string[]` to `Asset[]` so that the type correctly reflects that assets can be either glob strings or `AssetEntry` objects, matching the actual runtime behavior in `AssetsManager.copyAssets()`.
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.
What kind of change does this PR introduce?
Bug fix (type definition correction)
What is the current behavior?
The
Assettype inlib/configuration/configuration.tsis defined as:This is a string literal type — it only matches the exact word
"string", not any arbitrary string. This has been incorrect since the type was first introduced in v6.10.0 (commit 698c460).Additionally,
CompilerOptions.assetsis typed asstring[], which doesn't account forAssetEntryobjects that are also valid asset values.What is the new behavior?
Assettype is corrected from'string' | AssetEntrytostring | AssetEntry— a proper union of any string withAssetEntryobjects.CompilerOptions.assetsis updated fromstring[]toAsset[]— correctly reflecting that assets can be either glob strings (e.g.,"**/*.graphql") orAssetEntryobjects (e.g.,{ include: "**/*.hbs", outDir: "dist" }).This matches the runtime behavior in
AssetsManager.copyAssets()which checkstypeof item === 'string'to differentiate between the two forms.Additional context
tsc --noEmit) passes with no errorsAssettype was first introduced