@lark-apaas/miaoda-presets 0.1.0-alpha.overlay.1 → 0.1.0-alpha.overlay.3
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/lib/overlay/index.js
CHANGED
|
@@ -141,18 +141,19 @@ async function copyToClipboard(text) {
|
|
|
141
141
|
}
|
|
142
142
|
// 获取父窗口 origin
|
|
143
143
|
function getPreviewParentOrigin() {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
const { origin } = window.location;
|
|
145
|
+
// 线上环境
|
|
146
|
+
if (origin.includes('feishuapp.cn') ||
|
|
147
|
+
origin.includes('miaoda.feishuapp.net')) {
|
|
148
|
+
return 'https://miaoda.feishu.cn';
|
|
149
|
+
}
|
|
150
|
+
// PRE 环境
|
|
151
|
+
if (origin.includes('fsapp.kundou.cn') ||
|
|
152
|
+
origin.includes('miaoda-pre.feishuapp.net')) {
|
|
153
|
+
return 'https://miaoda.feishu-pre.cn';
|
|
153
154
|
}
|
|
154
|
-
//
|
|
155
|
-
return '
|
|
155
|
+
// BOE 环境
|
|
156
|
+
return 'https://miaoda.feishu-boe.cn';
|
|
156
157
|
}
|
|
157
158
|
/**
|
|
158
159
|
* Creates the main `div` element for the overlay to render.
|
|
@@ -184,7 +185,7 @@ function render() {
|
|
|
184
185
|
else if (currentRuntimeErrors.length) {
|
|
185
186
|
currentMode = 'runtimeError';
|
|
186
187
|
let errors = '';
|
|
187
|
-
currentRuntimeErrors.forEach(
|
|
188
|
+
currentRuntimeErrors.forEach(error => {
|
|
188
189
|
errors += `${error.message}\n${error.stack}\n`;
|
|
189
190
|
});
|
|
190
191
|
// 叠加全部报错,将报错信息发送到妙搭
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const ReactRefreshPlugin = require('@rspack/plugin-react-refresh');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
function createReactRefreshPlugin() {
|
|
5
|
+
return new ReactRefreshPlugin({
|
|
6
|
+
overlay: {
|
|
7
|
+
module: path.resolve(__dirname, 'overlay/index.js'),
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
module.exports = createReactRefreshPlugin;
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.pluginOption = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
exports.pluginOption = {
|
|
9
|
-
overlay: {
|
|
10
|
-
module: path_1.default.resolve(__dirname, 'overlay/index.js'),
|
|
11
|
-
},
|
|
12
|
-
};
|