@lark-apaas/coding-html-devserver 0.1.11-alpha.20260909092256 → 0.1.11-alpha.20260909113151
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/transform/runtime.js +4 -2
- package/package.json +1 -1
package/lib/transform/runtime.js
CHANGED
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runtimeTags = runtimeTags;
|
|
4
4
|
/**
|
|
5
|
-
* 注入 `@lark-apaas/miaoda-coding-sdk` 的
|
|
5
|
+
* 注入 `@lark-apaas/miaoda-coding-sdk` 的 runtime 产物(TEA 页面浏览埋点 + 水印)。
|
|
6
6
|
*
|
|
7
|
+
* - **入口**按 MIAODA_APP_SOURCE 选:doubao 来源 → `doubao-runtime`,其余 → `runtime`。
|
|
7
8
|
* - **变体**按 mode 选:dev → `.dev.js`(不自动上报、可调试);build → `.min.js`(引入即自动上报 VIEW)。
|
|
8
9
|
* - 走 sf3-scmcdn,版本即 URL(精确 pin、不可变)。
|
|
9
10
|
*
|
|
10
11
|
* 依赖 `window.collectEvent`(slardar 注入的 Tea collector)与 `window.appId`(view-context),
|
|
11
12
|
* 故须排在二者之后注入。
|
|
12
13
|
*/
|
|
14
|
+
const DOUBAO_SOURCE = '5';
|
|
13
15
|
/** miaoda-coding-sdk 的 CDN 版本(发布后随版本回填)。 */
|
|
14
16
|
const CODING_SDK_VERSION = '0.0.1';
|
|
15
17
|
/** sf3 SCM CDN 基址。 */
|
|
16
18
|
const CDN_BASE = 'https://sf3-scmcdn-cn.feishucdn.com/obj/feishu-static/miaoda/coding-sdk';
|
|
17
19
|
/** miaoda-coding-sdk runtime 的 head-prepend script tag(dev → .dev.js / build → .min.js)。 */
|
|
18
20
|
function runtimeTags(mode) {
|
|
19
|
-
const entry = 'doubao-runtime';
|
|
21
|
+
const entry = String(process.env.MIAODA_APP_SOURCE) === DOUBAO_SOURCE ? 'doubao-runtime' : 'runtime';
|
|
20
22
|
const variant = mode === 'dev' ? 'dev' : 'min';
|
|
21
23
|
const src = `${CDN_BASE}/${CODING_SDK_VERSION}/${entry}.${variant}.js`;
|
|
22
24
|
return [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/coding-html-devserver",
|
|
3
|
-
"version": "0.1.11-alpha.
|
|
3
|
+
"version": "0.1.11-alpha.20260909113151",
|
|
4
4
|
"description": "Dev/build toolchain for the miaoda-coding html (pure HTML) stack. Wraps vite (dev + HMR) behind a bin so the template never sees vite; build is pure-copy + platform-script injection + optional minify.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|