@yangyongtao/gaea 1.1.32 → 1.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.33] - 2026-09-09
4
+
5
+ ### Added
6
+ - dev 环境(`vite dev`)自动使用本地 `/Gaea` 加载引擎资源(走 vite dev server 中间件,从包内 public 读取),本地开发无需访问线上资源服务器
7
+
3
8
  ## [1.1.32] - 2026-09-09
4
9
 
5
10
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yangyongtao/gaea",
3
- "version": "1.1.32",
3
+ "version": "1.1.33",
4
4
  "description": "Gaea 3D visualization component library - Vue 3 components based on Godot WASM engine. Includes WMTS layer loading, camera view control, Vite plugin auto-injection, etc.",
5
5
  "type": "module",
6
6
  "main": "src/index.cjs",
@@ -125,15 +125,19 @@ const DEFAULT_ENGINE_ASSETS_URL = 'http://172.20.176.100:7072/gaea/Gaea';
125
125
  /**
126
126
  * 解析默认 executable:
127
127
  * 优先级:运行时全局变量 window.__GAEA_ASSETS_URL__(宿主站点 config.js 可设置,
128
- * 换地址无需重新打包)> 构建环境变量 VITE_GAEA_EXECUTABLE > 内置默认地址。
128
+ * 换地址无需重新打包)> dev 环境本地 /Gaea(走 vite dev server 中间件,不依赖线上)
129
+ * > 构建环境变量 VITE_GAEA_EXECUTABLE > 内置默认资源服务器地址。
129
130
  */
130
131
  function resolveDefaultExecutable() {
131
132
  if (typeof window !== 'undefined' && window.__GAEA_ASSETS_URL__) {
132
133
  return window.__GAEA_ASSETS_URL__;
133
134
  }
134
135
  try {
135
- if (import.meta.env && import.meta.env.VITE_GAEA_EXECUTABLE) {
136
- return import.meta.env.VITE_GAEA_EXECUTABLE;
136
+ if (import.meta.env) {
137
+ // dev 开发:引擎资源走 vite dev server 中间件(本地 gaea public),无需访问线上
138
+ if (import.meta.env.DEV) return '/Gaea';
139
+ // 构建时可用环境变量覆盖(如本地测试 build 产物指向本地资源服务器)
140
+ if (import.meta.env.VITE_GAEA_EXECUTABLE) return import.meta.env.VITE_GAEA_EXECUTABLE;
137
141
  }
138
142
  } catch (e) {
139
143
  /* 非 vite 环境忽略 */