updats on the dispatch page

This commit is contained in:
2026-09-10 17:57:00 +05:30
parent 79a8f2b234
commit 8b2c4daef8
34 changed files with 6929 additions and 1059 deletions

19
tools/css-hooks.mjs Normal file
View File

@@ -0,0 +1,19 @@
/**
* Make `import './thing.css'` a no-op under the Node test runner.
*
* Vite turns a CSS import into a side effect that injects a stylesheet; Node
* has no such notion and refuses the file outright with
* ERR_UNKNOWN_FILE_EXTENSION. That is fine for the pure tests, which never
* import a component — but the map has to be MOUNTED to be tested at all, and
* leaflet's own stylesheet comes with it.
*
* Styling is not what those tests check. They count polylines and markers in
* the document, which leaflet creates regardless of whether any CSS loaded. So
* every `.css` specifier resolves to an empty module and the import vanishes.
*/
export function resolve(specifier, context, next) {
if (specifier.endsWith('.css')) {
return { url: 'data:text/javascript,export default {}', shortCircuit: true };
}
return next(specifier, context);
}