Skip to content

Commit

Permalink
Fix: prevent bundling demo XForm XML fixtures as inline data: URLs
Browse files Browse the repository at this point in the history
This ensures that XForm fixtures loaded by URL are always reachable with the current access mechanism.
  • Loading branch information
eyelidlessness committed Oct 2, 2024
1 parent 5e56fef commit bfd99ec
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/web-forms/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,26 @@ export default defineConfig(({ mode }) => {
},
build: {
target: 'esnext',
/**
* Prevent bundling XForm fixture assets as inlined `data:` URLs.
*
* Per Vite's documentation, returning `false` opts out of inlining for
* assets with a `.xml` extension; for all other assets, we do not return
* a value, deferring to Vite's default behavior. We'll generally want the
* default behavior, but this comment should serve as a breadcrumb if we
* need to reconsider that assumption.
*
* @see
* {@link https://vite.dev/config/build-options.html#build-assetsinlinelimit}
*/
assetsInlineLimit: (filePath) => {
// Prevent inlining XML form fixture assets as `data:` URLs.
if (filePath.endsWith('.xml')) {
return false;
}

// Per Vite docs
},
lib,
rollupOptions: {
external,
Expand Down

0 comments on commit bfd99ec

Please sign in to comment.