mirror of
https://github.com/storytold/spark.git
synced 2026-10-18 07:40:38 +00:00
Fix import paths. sparkjs-dev to sparkjsdev
This commit is contained in:
@@ -68,7 +68,7 @@
|
|||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
SplatEditRgbaBlendMode,
|
SplatEditRgbaBlendMode,
|
||||||
FpsMovement,
|
FpsMovement,
|
||||||
PointerControls,
|
PointerControls,
|
||||||
} from "@sparkjs-dev/spark";
|
} from "@sparkjsdev/spark";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
const canvas = document.getElementById("canvas");
|
const canvas = document.getElementById("canvas");
|
||||||
|
|||||||
@@ -48,14 +48,14 @@
|
|||||||
<div id="progress-bar">
|
<div id="progress-bar">
|
||||||
<div id="progress-fill"></div>
|
<div id="progress-fill"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="/examples/js/vendor/stats.js/build/stats.min.js"></script>
|
||||||
<script type="importmap">
|
<script type="importmap">
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js",
|
"@sparkjsdev/spark": "/dist/spark.module.js",
|
||||||
"lil-gui": "../node_modules/lil-gui/dist/lil-gui.esm.js",
|
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.js"
|
||||||
"stats.js": "../node_modules/stats.js/build/stats.min.js"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -67,8 +67,7 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
||||||
import { GUI } from "lil-gui";
|
import { GUI } from "lil-gui";
|
||||||
import Stats from "stats.js";
|
import { constructGrid, SparkControls, SparkRenderer, SplatMesh, textSplats, dyno, transcodeSpz } from "@sparkjsdev/spark";
|
||||||
import { constructGrid, SparkControls, SparkRenderer, SplatMesh, textSplats, dyno, transcodeSpz } from "@sparkjs-dev/spark";
|
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
const scene = new THREE.Scene();
|
const scene = new THREE.Scene();
|
||||||
|
|||||||
@@ -33,13 +33,13 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
const scene = new THREE.Scene();
|
const scene = new THREE.Scene();
|
||||||
|
|||||||
@@ -25,13 +25,13 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
||||||
import { EXRLoader } from "three/addons/loaders/EXRLoader.js";
|
import { EXRLoader } from "three/addons/loaders/EXRLoader.js";
|
||||||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SplatMesh } from "@sparkjs-dev/spark";
|
import { SplatMesh } from "@sparkjsdev/spark";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
// Add loading icon in the center of the screen
|
// Add loading icon in the center of the screen
|
||||||
|
|||||||
@@ -28,13 +28,13 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { EXRLoader } from "three/addons/loaders/EXRLoader.js";
|
||||||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
"three/addons/": "/examples/js/vendor/three/examples/jsm/",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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 { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.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>
|
</script>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
PointerControls,
|
PointerControls,
|
||||||
SplatMesh,
|
SplatMesh,
|
||||||
VRButton,
|
VRButton,
|
||||||
} from "@sparkjs-dev/spark";
|
} from "@sparkjsdev/spark";
|
||||||
import GUI from "lil-gui";
|
import GUI from "lil-gui";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"lil-gui": "/examples/js/vendor/lil-gui/dist/lil-gui.esm.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>
|
</script>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
PointerControls,
|
PointerControls,
|
||||||
SplatMesh,
|
SplatMesh,
|
||||||
generators,
|
generators,
|
||||||
} from "@sparkjs-dev/spark";
|
} from "@sparkjsdev/spark";
|
||||||
import GUI from "lil-gui";
|
import GUI from "lil-gui";
|
||||||
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
const scene = new THREE.Scene();
|
const scene = new THREE.Scene();
|
||||||
|
|||||||
@@ -26,13 +26,13 @@
|
|||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "/examples/js/vendor/three/build/three.module.js",
|
"three": "/examples/js/vendor/three/build/three.module.js",
|
||||||
"@sparkjs-dev/spark": "/dist/spark.module.js"
|
"@sparkjsdev/spark": "/dist/spark.module.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import * as THREE from "three";
|
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";
|
import { getAssetFileURL } from "/examples/js/get-asset-url.js";
|
||||||
|
|
||||||
const scene = new THREE.Scene();
|
const scene = new THREE.Scene();
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ await rename("docs/examples/viewer", "docs/viewer");
|
|||||||
await mkdir("docs/examples/vendor", { recursive: true });
|
await mkdir("docs/examples/vendor", { recursive: true });
|
||||||
copyDir("node_modules/three", "docs/examples/js/vendor/three");
|
copyDir("node_modules/three", "docs/examples/js/vendor/three");
|
||||||
copyDir("node_modules/lil-gui", "docs/examples/js/vendor/lil-gui");
|
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");
|
copyDir("dist", "docs/dist");
|
||||||
console.log("Site generated in docs directory.");
|
console.log("Site generated in docs directory.");
|
||||||
|
|||||||
@@ -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}`);
|
console.log(`📦 Dev alias active: ${urlPath} → ${filePath}`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user