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
+2 -2
View File
@@ -68,7 +68,7 @@
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
@@ -83,7 +83,7 @@
SplatEditRgbaBlendMode,
FpsMovement,
PointerControls,
} from "@sparkjs-dev/spark";
} from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
const canvas = document.getElementById("canvas");
+4 -5
View File
@@ -48,14 +48,14 @@
<div id="progress-bar">
<div id="progress-fill"></div>
</div>
<script src="/examples/js/vendor/stats.js/build/stats.min.js"></script>
<script type="importmap">
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js",
"lil-gui": "../node_modules/lil-gui/dist/lil-gui.esm.js",
"stats.js": "../node_modules/stats.js/build/stats.min.js"
"@sparkjsdev/spark": "/dist/spark.module.js",
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.js"
}
}
</script>
@@ -67,8 +67,7 @@
import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
import { GUI } from "lil-gui";
import Stats from "stats.js";
import { constructGrid, SparkControls, SparkRenderer, SplatMesh, textSplats, dyno, transcodeSpz } from "@sparkjs-dev/spark";
import { constructGrid, SparkControls, SparkRenderer, SplatMesh, textSplats, dyno, transcodeSpz } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
const scene = new THREE.Scene();
+2 -2
View File
@@ -33,13 +33,13 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh, SparkControls, SparkRenderer } from "@sparkjs-dev/spark";
import { SplatMesh, SparkControls, SparkRenderer } from "@sparkjsdev/spark";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
+2 -2
View File
@@ -16,13 +16,13 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh } from "@sparkjs-dev/spark";
import { SplatMesh } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
+2 -2
View File
@@ -16,13 +16,13 @@
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh } from "@sparkjs-dev/spark";
import { SplatMesh } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
const scene = new THREE.Scene();
+2 -2
View File
@@ -25,13 +25,13 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh } from "@sparkjs-dev/spark";
import { SplatMesh } from "@sparkjsdev/spark";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { EXRLoader } from "three/addons/loaders/EXRLoader.js";
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
+1 -1
View File
@@ -1,4 +1,4 @@
import { SplatMesh } from "@sparkjs-dev/spark";
import { SplatMesh } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
// Add loading icon in the center of the screen
+2 -2
View File
@@ -28,13 +28,13 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh } from "@sparkjs-dev/spark";
import { SplatMesh } from "@sparkjsdev/spark";
import { EXRLoader } from "three/addons/loaders/EXRLoader.js";
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
+2 -2
View File
@@ -18,13 +18,13 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SparkRenderer, SparkViewpoint, SplatMesh } from "@sparkjs-dev/spark";
import { SparkRenderer, SparkViewpoint, SplatMesh } from "@sparkjsdev/spark";
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
+2 -2
View File
@@ -26,7 +26,7 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
@@ -37,7 +37,7 @@
PointerControls,
SplatMesh,
VRButton,
} from "@sparkjs-dev/spark";
} from "@sparkjsdev/spark";
import GUI from "lil-gui";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
+2 -2
View File
@@ -19,7 +19,7 @@
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
@@ -30,7 +30,7 @@
PointerControls,
SplatMesh,
generators,
} from "@sparkjs-dev/spark";
} from "@sparkjsdev/spark";
import GUI from "lil-gui";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
+2 -2
View File
@@ -16,13 +16,13 @@
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SparkControls, SplatMesh, constructGrid, constructAxes, textSplats, imageSplats } from "@sparkjs-dev/spark";
import { SparkControls, SplatMesh, constructGrid, constructAxes, textSplats, imageSplats } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
const scene = new THREE.Scene();
+2 -2
View File
@@ -26,13 +26,13 @@
{
"imports": {
"three": "/examples/js/vendor/three/build/three.module.js",
"@sparkjs-dev/spark": "/dist/spark.module.js"
"@sparkjsdev/spark": "/dist/spark.module.js"
}
}
</script>
<script type="module">
import * as THREE from "three";
import { SplatMesh, PackedSplats } from "@sparkjs-dev/spark";
import { SplatMesh, PackedSplats } from "@sparkjsdev/spark";
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
const scene = new THREE.Scene();
+1
View File
@@ -26,5 +26,6 @@ await rename("docs/examples/viewer", "docs/viewer");
await mkdir("docs/examples/vendor", { recursive: true });
copyDir("node_modules/three", "docs/examples/js/vendor/three");
copyDir("node_modules/lil-gui", "docs/examples/js/vendor/lil-gui");
copyDir("node_modules/stats.js", "docs/examples/js/vendor/stats.js");
copyDir("dist", "docs/dist");
console.log("Site generated in docs directory.");
+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}`);
},
},