@lark-apaas/fullstack-rspack-preset 1.0.45 → 1.0.46

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.
@@ -171,8 +171,12 @@ class StaticAssetsPlugin {
171
171
  return `export default window.__STATIC_JSON__['${key}'];`;
172
172
  }
173
173
  else {
174
- const staticUrl = `${this.options.clientBasePath}/static/${relativePath}`;
175
- return `export default '${staticUrl}';`;
174
+ const envBaseUrl = typeof process !== 'undefined' ? process.env?.STATIC_ASSETS_BASE_URL : undefined;
175
+ // envBaseUrl (downloadURLPrefix) 已指向 static 目录,无需再拼 /static/
176
+ const staticUrl = envBaseUrl
177
+ ? `${envBaseUrl.replace(/\/+$/, '')}/${relativePath}`
178
+ : `${this.options.clientBasePath}/static/${relativePath}`;
179
+ return `export default ${JSON.stringify(staticUrl)};`;
176
180
  }
177
181
  }
178
182
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "files": [
5
5
  "lib",
6
6
  "patches",
@@ -31,8 +31,8 @@
31
31
  "@babel/parser": "^7.28.0",
32
32
  "@babel/traverse": "^7.28.0",
33
33
  "@babel/types": "^7.28.2",
34
- "@lark-apaas/devtool-kits": "^1.2.18",
35
- "@lark-apaas/miaoda-inspector-babel-plugin": "^1.0.2",
34
+ "@lark-apaas/devtool-kits": "^1.2.19",
35
+ "@lark-apaas/miaoda-inspector-babel-plugin": "^1.0.1",
36
36
  "@lark-apaas/styled-jsx": "^1.0.1",
37
37
  "@rspack/plugin-react-refresh": "^1.5.1",
38
38
  "@swc/plugin-styled-jsx": "^11.0.0",