fix(web): inline CSS stub loader for Vercel path resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
import { register } from "node:module";
|
import { register } from "node:module";
|
||||||
import { pathToFileURL } from "node:url";
|
register("data:text/javascript," + encodeURIComponent(`
|
||||||
register("./css-stub-loader.mjs", pathToFileURL("./"));
|
const STUB_EXT = ['.css', '.scss', '.sass', '.svg', '.png', '.jpg', '.jpeg', '.gif', '.ico', '.woff', '.woff2', '.ttf', '.eot'];
|
||||||
|
export function resolve(specifier, context, nextResolve) {
|
||||||
|
if (STUB_EXT.some(ext => specifier.endsWith(ext))) {
|
||||||
|
return { url: 'data:text/javascript,export default ""', shortCircuit: true };
|
||||||
|
}
|
||||||
|
return nextResolve(specifier, context);
|
||||||
|
}
|
||||||
|
`));
|
||||||
|
|||||||
Reference in New Issue
Block a user