Fix import paths. sparkjs-dev to sparkjsdev

This commit is contained in:
Diego Marcos Segura
2025-06-10 13:41:16 -07:00
parent 4c08a8db6d
commit 6ec3eb5f38
15 changed files with 66 additions and 28 deletions
+38
View File
@@ -49,6 +49,44 @@ export default defineConfig(({ mode }) => {
}
});
console.log(`📦 Dev alias active: ${urlPath} → ${filePath}`);
},
},
{
name: "serve-lil-gui-alias",
configureServer(server) {
const urlPath = "/examples/js/vendor/stats.js/";
const filePath = path.resolve("node_modules/lil-gui/");
server.middlewares.use(urlPath, (req, res, next) => {
if (fs.existsSync(filePath)) {
res.setHeader("Content-Type", "application/javascript");
fs.createReadStream(filePath).pipe(res);
} else {
res.statusCode = 404;
res.end("three.module.js not found");
}
});
console.log(`📦 Dev alias active: ${urlPath} → ${filePath}`);
},
},
{
name: "serve-statsjs-alias",
configureServer(server) {
const urlPath = "/examples/js/vendor/stats.js/";
const filePath = path.resolve("node_modules/stats.js/");
server.middlewares.use(urlPath, (req, res, next) => {
if (fs.existsSync(filePath)) {
res.setHeader("Content-Type", "application/javascript");
fs.createReadStream(filePath).pipe(res);
} else {
res.statusCode = 404;
res.end("three.module.js not found");
}
});
console.log(`📦 Dev alias active: ${urlPath} → ${filePath}`);
},
},