fix(plugins): fix file loader behavior [LIBS-399] #779
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.
Fixes https://dhis2.atlassian.net/browse/LIBS-399
It seems like the
file-loader
is mangling the css file from maplibre-gl (which doesn’t need compiling, strangely) and outputting all kinds of nasty junk that doesn’t work, like:static/media/javascript,__webpack_public_path__=….bin
static/media/svg+xml;base64,ASD:LKFDNAJKSD….bin
.bin
filesIn the maps app, this caused an "Filename too long" error that prevented building the app, and
svg
icons were broken when run in dev mode.Changing to the modern asset/resource "file loader" seems to fix it with no noticeable side effects.
This configuration was originally what I used when first making plugins, but I seem to remember there was a reason not to use it -- I think it had to do with CSS modules, but this config seems to be running and building fine in the PWA test app, the LL app, and the Maps app, so I don't see any reason not to use it now 🤷♂️