Fix .ts/.tsx UI overrides being silently ignored in Publisher and Devportal - #1411
Merged
Merged
Conversation
Shamly-Shanawaz
requested review from
HeshanSudarshana,
Krishanx92,
PasanT9,
RakhithaRR,
ashera96,
hisanhunais,
lasanthaS,
piyumaldk and
tharikaGitHub
as code owners
August 5, 2026 10:08
Contributor
📝 WalkthroughWalkthroughThe Devportal and Publisher webpack configurations now apply ChangesTypeScript loader integration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Shamly-Shanawaz
force-pushed
the
fix/5161-tsx-override-loader
branch
from
August 10, 2026 08:05
bc95568 to
ada2b4f
Compare
|
PasanT9
approved these changes
Aug 10, 2026
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.



Problem
.ts/.tsxfiles placed under<webapp>/override/srcfor Advanced UI Customization are silently ignored. The build completes with exit code 0 and emits no error or warning, so the missing override is very hard to detect..js/.jsxoverrides are applied correctly.Related Issue : Fixes wso2/api-manager#5161
Root cause
loader.jsperforms thesource/src→override/srcsubstitution, but it is registered only on the/\.(js|jsx)$/webpack rule. It is absent from the/\.tsx?$/rule, so TypeScript modules bypass the substitution entirely and are compiled straight fromsource/src.Fix
Register
loader.json the/\.tsx?$/rule in both portals. It is listed afterts-loaderso it runs first - webpack executes ausearray bottom-to-top, substituting the override before TypeScript compiles it. This mirrors the ordering already used by the adjacent/\.(js|jsx)$/rule.portals/publisher/src/main/webapp/webpack.config.jsportals/devportal/src/main/webapp/webpack.config.jsThe Admin portal is unaffected: no
.tsx?rule, nots-loader, notsconfig.json, nooverride/directory, zero TypeScript sources.Behaviour change
Because override TypeScript is now genuinely compiled, it is also type-checked against the web app's
tsconfig.json(strictmode). A.ts/.tsxfile underoverride/srccontaining a type error previously built green because it wasnever read, it will now fail the build with a TypeScript diagnostic. Nothing changes until the web application is next rebuilt.
Testing
Verified per portal by overriding a matched
.tsx/.jsxpair with distinct sentinel strings and greppingsite/public/dist/*.bundle.js:.tsxoverride sentinel.jsxoverride sentinel (control)The
.jsxcontrol passing in both builds isolates the failure to the TypeScript path. Confirmed forbuild:prodandbuild:dev, and at rendered-UI level in a running server. Also confirmed a type-broken override.tsxnow fails the build(
TS2322), substantiating the behaviour-change note.