mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
build internal rust lib
This commit is contained in:
1 parent
840e918890
commit
d838f3e166
6 files changed
+1145
-147
No files matched your search
@@ -22,19 +22,15 @@ export default defineConfig({
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
// Example: rewrite /@fs/path/to/wasm/* -> /wasm/*
|
||||
//'^/@fs/.vite/deps/spark_internal_rs_bg.wasm': {
|
||||
'^/@fs/.*vite/deps/.*.wasm$': {
|
||||
target: 'http://localhost:5173', // or another backend
|
||||
//rewrite: (path) =>
|
||||
// path.replace(/^\/@fs\/path\/to\/wasm\//, '/Users/bt/dev/storyteller/storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/spark_internal_rs_bg.wasm'),
|
||||
target: 'http://localhost:5173',
|
||||
rewrite: (path) => {
|
||||
const p = '/@fs/Users/bt/dev/storyteller/storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/spark_internal_rs_bg.wasm';
|
||||
console.log('path', p);
|
||||
// http://localhost:5173/@fs/Users/bt/dev/storyteller/storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/spark_internal_rs_bg.wasm
|
||||
|
||||
const replaced = path.replace('storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/', 'storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/');
|
||||
console.log('replaced', replaced);
|
||||
const replaced = path.replace(
|
||||
'storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/',
|
||||
'storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/'
|
||||
);
|
||||
console.log('original path', path);
|
||||
console.log('rewritten path', replaced);
|
||||
return replaced;
|
||||
},
|
||||
changeOrigin: true,
|
||||
|
||||
Generated
+1122
-132
File diff suppressed because it is too large.
Load diff
@@ -24,6 +24,7 @@
|
||||
"konva": "^9.3.20",
|
||||
"lodash": "^4.17.21",
|
||||
"lucide-react": "^0.512.0",
|
||||
"node": "^25.2.1",
|
||||
"pnpm": "^10.8.1",
|
||||
"posthog-js": "^1.141.0",
|
||||
"react": "18.3.1",
|
||||
@@ -92,6 +93,7 @@
|
||||
"vite": "^6.0.0",
|
||||
"vite-plugin-banner": "^0.8.0",
|
||||
"vite-plugin-dts": "~4.5.0",
|
||||
"vite-plugin-glsl": "^1.5.4",
|
||||
"vite-plugin-static-copy": "^2.3.1",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^3.0.0"
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
// "apps/editor2d/app/src/*",
|
||||
"apps/editor3d/app/src/*"
|
||||
],
|
||||
"@sparkjsdev/spark": [
|
||||
"vendor/spark/src/index.ts"
|
||||
]
|
||||
//"@sparkjsdev/spark": [
|
||||
// "vendor/spark/src/index.ts"
|
||||
//]
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@
|
||||
"lint": "biome check .",
|
||||
"lint:fix": "biome check . --fix",
|
||||
"lint:summary": "biome check --reporter=summary",
|
||||
"prepare": "",
|
||||
"prepare": "npm run build:wasm",
|
||||
"site:build": "npm run build && npm run site:clean && node scripts/copy-site-files.js && mkdocs build && node scripts/rename-assets-to-static.js",
|
||||
"site:clean": "node scripts/clean-site-files.js && node scripts/clean-site.js",
|
||||
"site:deploy": "npm run site:build && node scripts/deploy-site.js",
|
||||
|
||||
Vendored
+10
@@ -28,6 +28,15 @@ export default defineConfig(({ mode }) => {
|
||||
cacheDir: '../../node_modules/.vite/vendor/spark',
|
||||
appType: "mpa",
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'spark-internal-rs': path.resolve(
|
||||
__dirname,
|
||||
'rust/spark-internal-rs/pkg' // <-- or whatever actual path
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
plugins: [
|
||||
glsl({
|
||||
include: ["**/*.glsl"],
|
||||
@@ -90,6 +99,7 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
emptyOutDir: isFirstPass,
|
||||
},
|
||||
|
||||
|
||||
worker: {
|
||||
rollupOptions: {
|
||||
|
||||
Reference in new issue
Block a user