Skip to content

Commit af2a6dd

Browse files
Stop adding source maps to offline assets list (#68)
## Motivation for the change, related issues When I enabled source maps for the website build in [bba856f](bba856f), the source maps were inadvertently added to the list of assets required for working offline. Source maps are not needed to run Playground offline, and they can be quite large. So we need to remove them from the list. ## Implementation details This PR adds a new exclusion pattern so source maps are no longer included in `assets-required-for-offline-mode.json`. ## Testing Instructions (or ideally a Blueprint) - On trunk, build the website and save a copy of `dist/packages/playground/wasm-wordpress-net/assets-required-for-offline-mode.json` - Switch to this branch, rebuild the website, and save another copy of the above JSON file. - Confirm that there are no .js.map files referenced in the second JSON file. - On the command line run `diff <(cat old.json | sort) <(cat new.json | sort)` and confirm that the only differences are .js.map files missing from the second JSON file.
1 parent b12dc91 commit af2a6dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vite-extensions/vite-list-assets-required-for-offline-mode.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ const patternsToNotCache = [
1616
/\/lib\/.*/, // Remote lib files
1717
/\/test-fixtures\/.*/, // Test fixtures
1818
'/index.js',
19+
/**
20+
* Source maps are not required to run the site and can be quite large.
21+
*/
22+
/\.js\.map$/,
1923
/**
2024
* WordPress assets removed from the minified builds, for example:
2125
*

0 commit comments

Comments
 (0)