@wenbin_wb/dsh-bridge 1.0.2 → 1.0.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/client/build.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  // dsh-bridge 客户端打包:client/index.js → client/client.js
2
2
  import { mkdir, writeFile } from 'node:fs/promises';
3
+ import { readFileSync } from 'node:fs';
3
4
  import { dirname, resolve } from 'node:path';
4
5
  import { fileURLToPath } from 'node:url';
5
6
  import { build } from 'esbuild';
@@ -7,7 +8,8 @@ import { build } from 'esbuild';
7
8
  const sourceDir = dirname(fileURLToPath(import.meta.url));
8
9
  const packageRoot = resolve(sourceDir, '..');
9
10
  const outputPath = resolve(packageRoot, 'client/client.js');
10
- const loaderId = 'dsh-bridge';
11
+ // loaderId 必须与 package.json 的 name 一致(DSH 用它来验证 bundle 注册)
12
+ const loaderId = JSON.parse(readFileSync(resolve(packageRoot, 'package.json'), 'utf8')).name;
11
13
 
12
14
  const result = await build({
13
15
  entryPoints: [resolve(sourceDir, 'index.js')],
package/client/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  window.__ModuleLoader__.load({
2
- id: "dsh-bridge",
2
+ id: "@wenbin_wb/dsh-bridge",
3
3
  factory: (require) => {
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenbin_wb/dsh-bridge",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "DSH 多渠道接入桥:局域网二维码、自建隧道、机器人集成",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",