@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 +3 -1
- package/client/client.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
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