@tuya-sat/micro-script 3.0.27-beta.6 → 3.0.27-beta.7

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.
@@ -119,15 +119,17 @@ function insertScript($, debuggerConfig) {
119
119
  }
120
120
  : {})), readThemeConfig()));
121
121
  overrideNotification(saas);
122
- const saasInfo = fs.readJSONSync(path.join(process.cwd(), 'saas-info.config.json'));
123
- let $favicon = $('link[rel="icon"]');
124
- if (!$favicon.length) {
125
- $('head').prepend('<link rel="icon" />');
126
- $favicon = $('link[rel="icon"]');
122
+ if (fs.existsSync(path.join(process.cwd(), 'saas-info.config.json'))) {
123
+ const saasInfo = fs.readJSONSync(path.join(process.cwd(), 'saas-info.config.json'));
124
+ let $favicon = $('link[rel="icon"]');
125
+ if (!$favicon.length) {
126
+ $('head').prepend('<link rel="icon" />');
127
+ $favicon = $('link[rel="icon"]');
128
+ }
129
+ const favicon = (saasInfo === null || saasInfo === void 0 ? void 0 : saasInfo.favicon) ? saasInfo.favicon : 'https://images.tuyacn.com/rms-static/ae9ba1b0-41d4-11ec-89bb-d7b7de210e4b-1636514225995.png?tyName=favicon.png';
130
+ $favicon
131
+ .attr('href', favicon);
127
132
  }
128
- const favicon = (saasInfo === null || saasInfo === void 0 ? void 0 : saasInfo.favicon) ? saasInfo.favicon : 'https://images.tuyacn.com/rms-static/ae9ba1b0-41d4-11ec-89bb-d7b7de210e4b-1636514225995.png?tyName=favicon.png';
129
- $favicon
130
- .attr('href', favicon);
131
133
  // 本地开发态多语言剥离多语言平台,走本地多语言兜底逻辑
132
134
  delete _SDF.saas.saas_locales;
133
135
  $('head').append($('<script>').text(`window._SDF_CONFIG=${JSON.stringify(_SDF_CONFIG)};window._SDF=${JSON.stringify(_SDF)};window.__MAIN_APP_PUBLIC_PATH=${JSON.stringify(__MAIN_APP_PUBLIC_PATH)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-sat/micro-script",
3
- "version": "3.0.27-beta.6",
3
+ "version": "3.0.27-beta.7",
4
4
  "bin": "./dist/bin/cli.js",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
@@ -23,9 +23,9 @@
23
23
  "@babel/preset-typescript": "7.16.7",
24
24
  "@babel/traverse": "^7.20.13",
25
25
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
26
- "@tuya-sat/micro-dev-loader": "3.0.27-beta.6",
27
- "@tuya-sat/micro-dev-proxy": "3.0.27-beta.6",
28
- "@tuya-sat/micro-utils": "3.0.27-beta.6",
26
+ "@tuya-sat/micro-dev-loader": "3.0.27-beta.7",
27
+ "@tuya-sat/micro-dev-proxy": "3.0.27-beta.7",
28
+ "@tuya-sat/micro-utils": "3.0.27-beta.7",
29
29
  "@types/kill-port": "^2.0.0",
30
30
  "babel-loader": "8.2.4",
31
31
  "babel-plugin-import": "1.13.3",