Minor Changes
-
BREAKING CHANGE: In
createAssetServer, replace thefileMapoption with optional directory-basedmounts. Mounts recursively preserve the path beneath each public and filesystem root, keeping module URLs aligned with the filesystem hierarchy used for package resolution.When
mountsis omitted, the asset server uses{ app: 'app', npm: 'node_modules' }.To migrate an app whose
fileMapis equivalent to the new defaults, remove thefileMapoption entirely:// before createAssetServer({ basePath: '/assets', fileMap: { '/app/*path': 'app/*path', '/npm/*path': 'node_modules/*path', }, // ... }) // after createAssetServer({ basePath: '/assets', // ... })
To migrate custom
fileMaprules that preserve directory hierarchy, remove the trailing wildcard from both sides and renamefileMaptomounts:// before createAssetServer({ basePath: '/assets', fileMap: { '/source/*path': 'app/*path', '/vendor/*path': 'node_modules/*path', }, // ... }) // after createAssetServer({ basePath: '/assets', mounts: { source: 'app', vendor: 'node_modules', }, // ... })
-
Add
assetServer.getAssets()for listing browser-reachable files andassetServer.getAssetDetails(urlOrFile)for inspecting URL mappings, file types, access rules, and reachability status. These APIs use the asset server's configured mapping and access policy, so diagnostic results match request handling (see #11726).