@xgis/xgis3d-build 0.3.23 → 0.3.35

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/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # @xgis/xgis3d-build
2
2
 
3
- Build-tool integration for [`@xgis/xgis3d`](../xgis3d/README.md). Copies CesiumJS's runtime assets
4
- into your build output, serves them in dev, and sets `window.CESIUM_BASE_URL` so Cesium finds them.
5
-
6
- Part of the [XGIS3D monorepo](../../README.md).
3
+ Build-tool integration for [`@xgis/xgis3d`](https://www.npmjs.com/package/@xgis/xgis3d). Copies
4
+ CesiumJS's runtime assets into your build output, serves them in dev, and sets
5
+ the base URL meta tag so Cesium finds them.
7
6
 
8
7
  ## Install
9
8
 
@@ -13,7 +12,7 @@ Needed for `mapMode: '3d'` or `'both'`. A 2D-only application does not need it.
13
12
  pnpm add -D @xgis/xgis3d-build
14
13
  ```
15
14
 
16
- `@xgis/xgis3d` is a required peer. `vite` and `@rspack/core` are optional — install whichever you
15
+ `@xgis/xgis3d` is a required peer. `vite` and `@rspack/core` are optional. Install whichever you
17
16
  build with. Do not install `cesium`; this package reads the copy `@xgis/xgis3d` pins.
18
17
 
19
18
  ## Vite
@@ -27,8 +26,7 @@ export default defineConfig({
27
26
  })
28
27
  ```
29
28
 
30
- Handles dev and build. Respects `base`, including a full CDN origin. Working example:
31
- [`examples/npm-vite/`](../../examples/npm-vite).
29
+ Handles dev and build. Respects `base`, including a full CDN origin.
32
30
 
33
31
  ## Rspack
34
32
 
@@ -44,9 +42,8 @@ export default {
44
42
  }
45
43
  ```
46
44
 
47
- Requires `HtmlRspackPlugin` — that is where the base URL is injected, and the plugin warns at build
48
- time if it is absent. It also adds the assets to `devServer.static`. Working example:
49
- [`examples/npm-rspack/`](../../examples/npm-rspack).
45
+ Requires `HtmlRspackPlugin`; the base URL is injected into its output, and the plugin warns at build
46
+ time if `HtmlRspackPlugin` is missing. It also adds the assets to `devServer.static`.
50
47
 
51
48
  ## Other build tools
52
49
 
@@ -61,7 +58,7 @@ npx xgis-cesium-assets copy public
61
58
  Copied 4 Cesium asset directories and LICENSE.md to /app/public/cesium-1.143.0
62
59
 
63
60
  Add this to the <head> of your HTML, before any bundle script:
64
- <script>window.CESIUM_BASE_URL="/cesium-1.143.0"</script>
61
+ <meta name="xgis-cesium-base-url" content="/cesium-1.143.0" />
65
62
  ```
66
63
 
67
64
  | Flag | Effect |
@@ -69,7 +66,7 @@ Add this to the <head> of your HTML, before any bundle script:
69
66
  | `--base <name>` | Directory name under the target. Default `cesium-<version>` |
70
67
  | `--public-path <p>` | URL prefix for the printed tag, when the target is not the web root |
71
68
 
72
- Call it from a script rather than a `prebuild`/`prestart` hook — pnpm does not run npm pre/post
69
+ Call it from a script rather than a `prebuild`/`prestart` hook. pnpm does not run npm pre/post
73
70
  lifecycle scripts by default:
74
71
 
75
72
  ```json
@@ -94,27 +91,15 @@ const plan = planCesiumAssets({ base: 'cesium' })
94
91
  copyCesiumAssets(plan, 'dist')
95
92
  ```
96
93
 
97
- | Export | Purpose |
98
- | --------------------------------- | ----------------------------------------------------------- |
99
- | `planCesiumAssets(options?)` | Resolves Cesium, returns paths and the directory name |
100
- | `copyCesiumAssets(plan, outDir)` | Copies the four asset directories plus `LICENSE.md` |
101
- | `joinPublicPath(prefix, dir)` | Joins a build-tool path prefix with the asset directory |
102
- | `cesiumBaseUrlScript(publicPath)` | The `window.CESIUM_BASE_URL=…` assignment, escaped for HTML |
103
-
104
- `planCesiumAssets` throws on a `base` that is empty, traverses upwards, or contains `\` — it becomes
105
- both a URL segment and a directory name.
106
-
107
- ## What lives here
94
+ | Export | Purpose |
95
+ | -------------------------------- | ------------------------------------------------------- |
96
+ | `planCesiumAssets(options?)` | Resolves Cesium, returns paths and the directory name |
97
+ | `copyCesiumAssets(plan, outDir)` | Copies the four asset directories plus `LICENSE.md` |
98
+ | `joinPublicPath(prefix, dir)` | Joins a build-tool path prefix with the asset directory |
99
+ | `cesiumBaseUrlMeta(publicPath)` | Name and content for the base URL meta tag, validated |
108
100
 
109
- | File | Responsibility |
110
- | ------------------ | ---------------------------------------------------------- |
111
- | `cesiumAssets.ts` | The core. Resolve, plan, copy, base-URL string. No bundler |
112
- | `vite-plugin.ts` | `cesiumAssets()` |
113
- | `rspack-plugin.ts` | `CesiumAssetsRspackPlugin` |
114
- | `cliRun.ts` | `runCli()`, behind the `xgis-cesium-assets` bin |
115
-
116
- All of it runs in Node under a consumer's build config. `tsconfig.json` sets `lib: ["ES2023"]` with
117
- no DOM, so a browser API reaching this package fails to compile.
101
+ `planCesiumAssets` throws on a `base` that is empty, traverses upwards, or contains `\`, because the value
102
+ becomes both a URL segment and a directory name.
118
103
 
119
104
  ## Dependency policy
120
105
 
@@ -130,12 +115,6 @@ const requireFromXgis3d = createRequire(requireFromHere.resolve('@xgis/xgis3d/pa
130
115
  requireFromXgis3d.resolve('cesium/package.json')
131
116
  ```
132
117
 
133
- ## Docs
134
-
135
- - [Integration guide](../../docs/integration-guide.md) — Section 1, Cesium assets
136
- - [ADR-0022](../../docs/decisions/0022-bundler-agnostic-cesium-assets.md) — why this is a separate
137
- package, and why the base URL is not set with `define`
138
-
139
118
  ## License
140
119
 
141
- MIT. See [LICENSE](./LICENSE).
120
+ MIT. See the LICENSE file in this package.
@@ -1,7 +1,7 @@
1
1
  export declare const CESIUM_ASSET_ENTRIES: readonly ["Workers", "ThirdParty", "Assets", "Widgets"];
2
2
  export interface CesiumAssetsOptions {
3
3
  /**
4
- * Directory the assets are served under. Must match `window.CESIUM_BASE_URL`.
4
+ * Directory the assets are served under. Must match the base URL the runtime reads.
5
5
  * Defaults to `cesium-<version>`, which is what `ensureCesiumBaseUrl()` sets.
6
6
  */
7
7
  base?: string;
@@ -19,4 +19,9 @@ export declare function copyCesiumAssets(plan: CesiumAssetPlan, outDir: string):
19
19
  * directory. An empty prefix means "relative to the document", which is a deliberate setting.
20
20
  */
21
21
  export declare function joinPublicPath(prefix: string, dir: string): string;
22
- export declare function cesiumBaseUrlScript(publicPath: string): string;
22
+ export declare const CESIUM_BASE_URL_META = "xgis-cesium-base-url";
23
+ export interface CesiumBaseUrlMeta {
24
+ readonly name: string;
25
+ readonly content: string;
26
+ }
27
+ export declare function cesiumBaseUrlMeta(publicPath: string): CesiumBaseUrlMeta;
@@ -50,9 +50,15 @@ function joinPublicPath(prefix, dir) {
50
50
  const path = `${prefix.slice(origin.length)}/${dir}`.replace(/\/{2,}/g, "/");
51
51
  return `${origin}${path}`;
52
52
  }
53
- function cesiumBaseUrlScript(publicPath) {
54
- return `window.CESIUM_BASE_URL=${JSON.stringify(publicPath).replace(/</g, "\\u003c")}`;
53
+ const CESIUM_BASE_URL_META = "xgis-cesium-base-url";
54
+ function cesiumBaseUrlMeta(publicPath) {
55
+ if (/["<>]/.test(publicPath)) {
56
+ throw new Error(
57
+ `cesiumAssets: public path must not contain quotes or angle brackets, got ${JSON.stringify(publicPath)}`
58
+ );
59
+ }
60
+ return { name: CESIUM_BASE_URL_META, content: publicPath };
55
61
  }
56
62
 
57
- export { CESIUM_ASSET_ENTRIES, cesiumBaseUrlScript, copyCesiumAssets, joinPublicPath, planCesiumAssets };
63
+ export { CESIUM_ASSET_ENTRIES, CESIUM_BASE_URL_META, cesiumBaseUrlMeta, copyCesiumAssets, joinPublicPath, planCesiumAssets };
58
64
  //# sourceMappingURL=cesiumAssets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cesiumAssets.js","sources":["../src/cesiumAssets.ts"],"sourcesContent":["import { cpSync, existsSync, readFileSync, realpathSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join } from 'node:path'\n\n// Cesium loads these dynamically at runtime; a bundler bundles the JS library but never sees them.\nexport const CESIUM_ASSET_ENTRIES = ['Workers', 'ThirdParty', 'Assets', 'Widgets'] as const\n\nexport interface CesiumAssetsOptions {\n /**\n * Directory the assets are served under. Must match `window.CESIUM_BASE_URL`.\n * Defaults to `cesium-<version>`, which is what `ensureCesiumBaseUrl()` sets.\n */\n base?: string\n}\n\nexport interface CesiumAssetPlan {\n readonly source: string\n readonly licenseFile: string\n readonly dir: string\n readonly entries: readonly string[]\n}\n\n// Read rather than imported: the library build strips the attribute a bare .json import needs.\nconst requireFromHere = createRequire(import.meta.url)\n\n// Through @xgis/xgis3d, so the copied assets are the ones its runtime was built against.\nfunction cesiumPackageDir(): string {\n const xgis3dManifest = requireFromHere.resolve('@xgis/xgis3d/package.json')\n const requireFromXgis3d = createRequire(xgis3dManifest)\n\n return dirname(realpathSync(requireFromXgis3d.resolve('cesium/package.json')))\n}\n\n// `dir` is used as both a URL segment and a filesystem segment, so it has to be safe as both.\nfunction normaliseDir(base: string): string {\n const dir = base\n .replace(/^\\/+/, '')\n .replace(/\\/+$/, '')\n .replace(/\\/{2,}/g, '/')\n\n if (!dir) {\n throw new Error(`cesiumAssets: base must name a directory, got ${JSON.stringify(base)}`)\n }\n\n if (dir.includes('\\\\')) {\n throw new Error(`cesiumAssets: base must use \"/\" as a separator, got ${JSON.stringify(base)}`)\n }\n\n // Without this, `--base ../..` writes Cesium's build tree outside the output directory.\n if (dir.split('/').includes('..')) {\n throw new Error(`cesiumAssets: base must not traverse upwards, got ${JSON.stringify(base)}`)\n }\n\n return dir\n}\n\nexport function planCesiumAssets(options: CesiumAssetsOptions = {}): CesiumAssetPlan {\n const packageDir = cesiumPackageDir()\n const manifest = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8')) as {\n version: string\n }\n const source = join(packageDir, 'Build', 'Cesium')\n\n // Named here rather than as a bare ENOENT at the end of a long build.\n if (!existsSync(source)) {\n throw new Error(`cesiumAssets: Cesium build output not found at ${source}`)\n }\n\n return {\n source,\n licenseFile: join(packageDir, 'LICENSE.md'),\n dir: normaliseDir(options.base ?? `cesium-${manifest.version}`),\n entries: CESIUM_ASSET_ENTRIES,\n }\n}\n\nexport function copyCesiumAssets(plan: CesiumAssetPlan, outDir: string): void {\n for (const entry of plan.entries) {\n cpSync(join(plan.source, entry), join(outDir, plan.dir, entry), { recursive: true })\n }\n\n // Redistribution: Apache-2.0 4(a) for Cesium, BSD-3-Clause for ThirdParty/. LICENSE.md covers both.\n cpSync(plan.licenseFile, join(outDir, plan.dir, 'LICENSE.md'))\n}\n\n/**\n * Joins a build-tool path prefix (Vite `base`, Rspack `output.publicPath`) with the asset\n * directory. An empty prefix means \"relative to the document\", which is a deliberate setting.\n */\nexport function joinPublicPath(prefix: string, dir: string): string {\n if (!prefix) {\n return dir\n }\n\n // Only the path collapses; `https://cdn/` would otherwise become `https:/cdn/`.\n const origin = /^[a-z][a-z0-9+.-]*:\\/\\/[^/]*/i.exec(prefix)?.[0] ?? ''\n const path = `${prefix.slice(origin.length)}/${dir}`.replace(/\\/{2,}/g, '/')\n\n return `${origin}${path}`\n}\n\nexport function cesiumBaseUrlScript(publicPath: string): string {\n // Emitted as raw inline script content, and JSON.stringify escapes quotes but not `<`.\n return `window.CESIUM_BASE_URL=${JSON.stringify(publicPath).replace(/</g, '\\\\u003c')}`\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,oBAAA,GAAuB,CAAC,SAAA,EAAW,YAAA,EAAc,UAAU,SAAS;AAkBjF,MAAM,eAAA,GAAkB,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AAGrD,SAAS,gBAAA,GAA2B;AAClC,EAAA,MAAM,cAAA,GAAiB,eAAA,CAAgB,OAAA,CAAQ,2BAA2B,CAAA;AAC1E,EAAA,MAAM,iBAAA,GAAoB,cAAc,cAAc,CAAA;AAEtD,EAAA,OAAO,QAAQ,YAAA,CAAa,iBAAA,CAAkB,OAAA,CAAQ,qBAAqB,CAAC,CAAC,CAAA;AAC/E;AAGA,SAAS,aAAa,IAAA,EAAsB;AAC1C,EAAA,MAAM,GAAA,GAAM,IAAA,CACT,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,CAClB,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA,CAClB,OAAA,CAAQ,SAA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AAA,EAAS;AAAA,GACX;AACF;AAEO,SAAS,gBAAA,CAAiB,MAAuB,MAAA,EAAsB;AAC5E,EAAA,KAAA,MAAW,KAAA,IAAS,KAAK,OAAA,EAAS;AAChC,IAAA,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,KAAK,GAAG,IAAA,CAAK,MAAA,EAAQ,IAAA,CAAK,GAAA,EAAK,KAAK,CAAA,EAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAAA,EACrF;AAGA,EAAA,MAAA,CAAO,KAAK,WAAA,EAAa,IAAA,CAAK,QAAQ,IAAA,CAAK,GAAA,EAAK,YAAY,CAAC,CAAA;AAC/D;AAMO,SAAS,cAAA,CAAe,QAAgB,GAAA,EAAqB;AAClE,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,GAAA;AAAA,EACT;AAGA,EAAA,MAAM,SAAS,+BAAA,CAAgC,IAAA,CAAK,MAAM,CAAA,GAAI,CAAC,CAAA,IAAK,EAAA;AACpE,EAAA,MAAM,IAAA,GAAO,CAAA,EAAG,MAAA,CAAO,KAAA,CAAM,MAAA,CAAO,MAAM,CAAC,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA,CAAG,OAAA,CAAQ,SAAA,EAAW,GAAG,CAAA;AAE3E,EAAA,OAAO,CAAA,EAAG,MAAM,CAAA,EAAG,IAAI,CAAA,CAAA;AACzB;AAEO,SAAS,oBAAoB,UAAA,EAA4B;AAE9D,EAAA,OAAO,CAAA,uBAAA,EAA0B,KAAK,SAAA,CAAU,UAAU,EAAE,OAAA,CAAQ,IAAA,EAAM,SAAS,CAAC,CAAA,CAAA;AACtF;;;;"}
1
+ {"version":3,"file":"cesiumAssets.js","sources":["../src/cesiumAssets.ts"],"sourcesContent":["import { cpSync, existsSync, readFileSync, realpathSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join } from 'node:path'\n\n// Cesium loads these dynamically at runtime; a bundler bundles the JS library but never sees them.\nexport const CESIUM_ASSET_ENTRIES = ['Workers', 'ThirdParty', 'Assets', 'Widgets'] as const\n\nexport interface CesiumAssetsOptions {\n /**\n * Directory the assets are served under. Must match the base URL the runtime reads.\n * Defaults to `cesium-<version>`, which is what `ensureCesiumBaseUrl()` sets.\n */\n base?: string\n}\n\nexport interface CesiumAssetPlan {\n readonly source: string\n readonly licenseFile: string\n readonly dir: string\n readonly entries: readonly string[]\n}\n\n// Read rather than imported: the library build strips the attribute a bare .json import needs.\nconst requireFromHere = createRequire(import.meta.url)\n\n// Through @xgis/xgis3d, so the copied assets are the ones its runtime was built against.\nfunction cesiumPackageDir(): string {\n const xgis3dManifest = requireFromHere.resolve('@xgis/xgis3d/package.json')\n const requireFromXgis3d = createRequire(xgis3dManifest)\n\n return dirname(realpathSync(requireFromXgis3d.resolve('cesium/package.json')))\n}\n\n// `dir` is used as both a URL segment and a filesystem segment, so it has to be safe as both.\nfunction normaliseDir(base: string): string {\n const dir = base\n .replace(/^\\/+/, '')\n .replace(/\\/+$/, '')\n .replace(/\\/{2,}/g, '/')\n\n if (!dir) {\n throw new Error(`cesiumAssets: base must name a directory, got ${JSON.stringify(base)}`)\n }\n\n if (dir.includes('\\\\')) {\n throw new Error(`cesiumAssets: base must use \"/\" as a separator, got ${JSON.stringify(base)}`)\n }\n\n // Without this, `--base ../..` writes Cesium's build tree outside the output directory.\n if (dir.split('/').includes('..')) {\n throw new Error(`cesiumAssets: base must not traverse upwards, got ${JSON.stringify(base)}`)\n }\n\n return dir\n}\n\nexport function planCesiumAssets(options: CesiumAssetsOptions = {}): CesiumAssetPlan {\n const packageDir = cesiumPackageDir()\n const manifest = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8')) as {\n version: string\n }\n const source = join(packageDir, 'Build', 'Cesium')\n\n // Named here rather than as a bare ENOENT at the end of a long build.\n if (!existsSync(source)) {\n throw new Error(`cesiumAssets: Cesium build output not found at ${source}`)\n }\n\n return {\n source,\n licenseFile: join(packageDir, 'LICENSE.md'),\n dir: normaliseDir(options.base ?? `cesium-${manifest.version}`),\n entries: CESIUM_ASSET_ENTRIES,\n }\n}\n\nexport function copyCesiumAssets(plan: CesiumAssetPlan, outDir: string): void {\n for (const entry of plan.entries) {\n cpSync(join(plan.source, entry), join(outDir, plan.dir, entry), { recursive: true })\n }\n\n // Redistribution: Apache-2.0 4(a) for Cesium, BSD-3-Clause for ThirdParty/. LICENSE.md covers both.\n cpSync(plan.licenseFile, join(outDir, plan.dir, 'LICENSE.md'))\n}\n\n/**\n * Joins a build-tool path prefix (Vite `base`, Rspack `output.publicPath`) with the asset\n * directory. An empty prefix means \"relative to the document\", which is a deliberate setting.\n */\nexport function joinPublicPath(prefix: string, dir: string): string {\n if (!prefix) {\n return dir\n }\n\n // Only the path collapses; `https://cdn/` would otherwise become `https:/cdn/`.\n const origin = /^[a-z][a-z0-9+.-]*:\\/\\/[^/]*/i.exec(prefix)?.[0] ?? ''\n const path = `${prefix.slice(origin.length)}/${dir}`.replace(/\\/{2,}/g, '/')\n\n return `${origin}${path}`\n}\n\nexport const CESIUM_BASE_URL_META = 'xgis-cesium-base-url'\n\nexport interface CesiumBaseUrlMeta {\n readonly name: string\n readonly content: string\n}\n\n// Validated, not escaped: the CLI hands this to a person to paste with no bundler in between.\nexport function cesiumBaseUrlMeta(publicPath: string): CesiumBaseUrlMeta {\n if (/[\"<>]/.test(publicPath)) {\n throw new Error(\n `cesiumAssets: public path must not contain quotes or angle brackets, got ${JSON.stringify(publicPath)}`,\n )\n }\n\n return { name: CESIUM_BASE_URL_META, content: publicPath }\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,oBAAA,GAAuB,CAAC,SAAA,EAAW,YAAA,EAAc,UAAU,SAAS;AAkBjF,MAAM,eAAA,GAAkB,aAAA,CAAc,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AAGrD,SAAS,gBAAA,GAA2B;AAClC,EAAA,MAAM,cAAA,GAAiB,eAAA,CAAgB,OAAA,CAAQ,2BAA2B,CAA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;AAQ7B,SAAS,kBAAkB,UAAA,EAAuC;AACvE,EAAA,IAAI,OAAA,CAAQ,IAAA,CAAK,UAAU,CAAA,EAAG;AAC5B,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,yEAAA,EAA4E,IAAA,CAAK,SAAA,CAAU,UAAU,CAAC,CAAA;AAAA,KACxG;AAAA,EACF;AAEA,EAAA,OAAO,EAAE,IAAA,EAAM,oBAAA,EAAsB,OAAA,EAAS,UAAA,EAAW;AAC3D;;;;"}
package/dist/cliRun.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
- import { planCesiumAssets, copyCesiumAssets, joinPublicPath, cesiumBaseUrlScript } from './cesiumAssets.js';
2
+ import { planCesiumAssets, copyCesiumAssets, joinPublicPath, cesiumBaseUrlMeta } from './cesiumAssets.js';
3
3
 
4
4
  const USAGE = "Usage: xgis-cesium-assets copy <dir> [--base <name>] [--public-path <prefix>]";
5
5
  function runCli(argv) {
@@ -20,7 +20,7 @@ ${USAGE}`);
20
20
  `Copied ${plan.entries.length} Cesium asset directories and LICENSE.md to ${outDir}/${plan.dir}`,
21
21
  "",
22
22
  "Add this to the <head> of your HTML, before any bundle script:",
23
- ` <script>${cesiumBaseUrlScript(publicPath)}<\/script>`,
23
+ ` <meta name="${cesiumBaseUrlMeta(publicPath).name}" content="${publicPath}" />`,
24
24
  "",
25
25
  `If ${target} is not served at the site root, re-run with --public-path <prefix> to get the`,
26
26
  "right value, or adjust the path above to match."
@@ -1 +1 @@
1
- {"version":3,"file":"cliRun.js","sources":["../src/cliRun.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport {\n cesiumBaseUrlScript,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nconst USAGE = 'Usage: xgis-cesium-assets copy <dir> [--base <name>] [--public-path <prefix>]'\n\nexport function runCli(argv: string[]): string {\n const [command, target, ...rest] = argv\n\n if (command !== 'copy') {\n throw new Error(`Unknown command: ${command ?? '(none)'}\\n${USAGE}`)\n }\n\n if (!target || target.startsWith('-')) {\n throw new Error(`Expected a target directory, got ${target ?? '(none)'}\\n${USAGE}`)\n }\n\n const plan = planCesiumAssets({ base: readFlag(rest, '--base') })\n const outDir = resolve(process.cwd(), target)\n\n copyCesiumAssets(plan, outDir)\n\n // Disk location says nothing about the served URL, so the prefix is given rather than guessed.\n const publicPath = joinPublicPath(readFlag(rest, '--public-path') ?? '/', plan.dir)\n\n return [\n `Copied ${plan.entries.length} Cesium asset directories and LICENSE.md to ${outDir}/${plan.dir}`,\n '',\n 'Add this to the <head> of your HTML, before any bundle script:',\n ` <script>${cesiumBaseUrlScript(publicPath)}</script>`,\n '',\n `If ${target} is not served at the site root, re-run with --public-path <prefix> to get the`,\n 'right value, or adjust the path above to match.',\n ].join('\\n')\n}\n\nfunction readFlag(args: string[], flag: string): string | undefined {\n const inline = args.find((arg) => arg.startsWith(`${flag}=`))\n\n if (inline) {\n return requireValue(inline.slice(flag.length + 1), flag)\n }\n\n const index = args.indexOf(flag)\n\n if (index === -1) {\n return undefined\n }\n\n const value = args[index + 1]\n\n if (value === undefined || value.startsWith('-')) {\n throw new Error(`${flag} needs a value\\n${USAGE}`)\n }\n\n return requireValue(value, flag)\n}\n\nfunction requireValue(value: string, flag: string): string {\n if (!value) {\n throw new Error(`${flag} needs a value\\n${USAGE}`)\n }\n\n return value\n}\n"],"names":[],"mappings":";;;AASA,MAAM,KAAA,GAAQ,+EAAA;AAEP,SAAS,OAAO,IAAA,EAAwB;AAC7C,EAAA,MAAM,CAAC,OAAA,EAAS,MAAA,EAAQ,GAAG,IAAI,CAAA,GAAI,IAAA;AAEnC,EAAA,IAAI,YAAY,MAAA,EAAQ;AACtB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iBAAA,EAAoB,OAAA,IAAW,QAAQ;AAAA,EAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,CAAC,MAAA,IAAU,MAAA,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/B,EAAA,IAAI,UAAU,EAAA,EAAI;AAChB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,KAAA,GAAQ,CAAC,CAAA;AAE5B,EAAA,IAAI,KAAA,KAAU,MAAA,IAAa,KAAA,CAAM,UAAA,CAAW,GAAG,CAAA,EAAG;AAChD,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA;AAAA,EAAmB,KAAK,CAAA,CAAE,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,YAAA,CAAa,OAAO,IAAI,CAAA;AACjC;AAEA,SAAS,YAAA,CAAa,OAAe,IAAA,EAAsB;AACzD,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA;AAAA,EAAmB,KAAK,CAAA,CAAE,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
1
+ {"version":3,"file":"cliRun.js","sources":["../src/cliRun.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport {\n cesiumBaseUrlMeta,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nconst USAGE = 'Usage: xgis-cesium-assets copy <dir> [--base <name>] [--public-path <prefix>]'\n\nexport function runCli(argv: string[]): string {\n const [command, target, ...rest] = argv\n\n if (command !== 'copy') {\n throw new Error(`Unknown command: ${command ?? '(none)'}\\n${USAGE}`)\n }\n\n if (!target || target.startsWith('-')) {\n throw new Error(`Expected a target directory, got ${target ?? '(none)'}\\n${USAGE}`)\n }\n\n const plan = planCesiumAssets({ base: readFlag(rest, '--base') })\n const outDir = resolve(process.cwd(), target)\n\n copyCesiumAssets(plan, outDir)\n\n // Disk location says nothing about the served URL, so the prefix is given rather than guessed.\n const publicPath = joinPublicPath(readFlag(rest, '--public-path') ?? '/', plan.dir)\n\n return [\n `Copied ${plan.entries.length} Cesium asset directories and LICENSE.md to ${outDir}/${plan.dir}`,\n '',\n 'Add this to the <head> of your HTML, before any bundle script:',\n ` <meta name=\"${cesiumBaseUrlMeta(publicPath).name}\" content=\"${publicPath}\" />`,\n '',\n `If ${target} is not served at the site root, re-run with --public-path <prefix> to get the`,\n 'right value, or adjust the path above to match.',\n ].join('\\n')\n}\n\nfunction readFlag(args: string[], flag: string): string | undefined {\n const inline = args.find((arg) => arg.startsWith(`${flag}=`))\n\n if (inline) {\n return requireValue(inline.slice(flag.length + 1), flag)\n }\n\n const index = args.indexOf(flag)\n\n if (index === -1) {\n return undefined\n }\n\n const value = args[index + 1]\n\n if (value === undefined || value.startsWith('-')) {\n throw new Error(`${flag} needs a value\\n${USAGE}`)\n }\n\n return requireValue(value, flag)\n}\n\nfunction requireValue(value: string, flag: string): string {\n if (!value) {\n throw new Error(`${flag} needs a value\\n${USAGE}`)\n }\n\n return value\n}\n"],"names":[],"mappings":";;;AASA,MAAM,KAAA,GAAQ,+EAAA;AAEP,SAAS,OAAO,IAAA,EAAwB;AAC7C,EAAA,MAAM,CAAC,OAAA,EAAS,MAAA,EAAQ,GAAG,IAAI,CAAA,GAAI,IAAA;AAEnC,EAAA,IAAI,YAAY,MAAA,EAAQ;AACtB,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iBAAA,EAAoB,OAAA,IAAW,QAAQ;AAAA,EAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,CAAC,MAAA,IAAU,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA,EAAG;AACrC,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,iCAAA,EAAoC,MAAA,IAAU,QAAQ;AAAA,EAAK,KAAK,CAAA,CAAE,CAAA;AAAA,EACpF;AAEA,EAAA,MAAM,IAAA,GAAO,iBAAiB,EAAE,IAAA,EAAM,SAAS,IAAA,EAAM,QAAQ,GAAG,CAAA;AAChE,EAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,OAAA,CAA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mB,KAAK,CAAA,CAAE,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,YAAA,CAAa,OAAO,IAAI,CAAA;AACjC;AAEA,SAAS,YAAA,CAAa,OAAe,IAAA,EAAsB;AACzD,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,IAAI,CAAA;AAAA,EAAmB,KAAK,CAAA,CAAE,CAAA;AAAA,EACnD;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
@@ -1,4 +1,4 @@
1
- import { planCesiumAssets, copyCesiumAssets, cesiumBaseUrlScript, joinPublicPath } from './cesiumAssets.js';
1
+ import { planCesiumAssets, copyCesiumAssets, cesiumBaseUrlMeta, joinPublicPath } from './cesiumAssets.js';
2
2
 
3
3
  const PLUGIN_NAME = "CesiumAssetsRspackPlugin";
4
4
  class CesiumAssetsRspackPlugin {
@@ -28,7 +28,7 @@ class CesiumAssetsRspackPlugin {
28
28
  if (!hasHtmlPlugin(compiler, HtmlRspackPlugin)) {
29
29
  compilation.warnings.push(
30
30
  new Error(
31
- `${PLUGIN_NAME}: HtmlRspackPlugin is required to inject window.CESIUM_BASE_URL. Set it to "${publicPath}" yourself if you generate HTML another way.`
31
+ `${PLUGIN_NAME}: HtmlRspackPlugin is required to inject the Cesium base URL meta tag. Set it to "${publicPath}" yourself if you generate HTML another way.`
32
32
  )
33
33
  );
34
34
  return;
@@ -37,10 +37,9 @@ class CesiumAssetsRspackPlugin {
37
37
  PLUGIN_NAME,
38
38
  (data) => {
39
39
  data.headTags.unshift({
40
- tagName: "script",
41
- voidTag: false,
42
- attributes: {},
43
- innerHTML: cesiumBaseUrlScript(publicPath)
40
+ tagName: "meta",
41
+ voidTag: true,
42
+ attributes: { ...cesiumBaseUrlMeta(publicPath) }
44
43
  });
45
44
  return data;
46
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rspack-plugin.js","sources":["../src/rspack-plugin.ts"],"sourcesContent":["import type { Compiler } from '@rspack/core'\n\nimport type { CesiumAssetPlan, CesiumAssetsOptions } from './cesiumAssets'\nimport {\n cesiumBaseUrlScript,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nconst PLUGIN_NAME = 'CesiumAssetsRspackPlugin'\n\n/**\n * Copies Cesium's runtime assets (workers, textures, widget CSS) into the compilation output,\n * serves them in dev, and injects `window.CESIUM_BASE_URL` into the HTML HtmlRspackPlugin emits.\n */\nexport class CesiumAssetsRspackPlugin {\n private readonly plan: CesiumAssetPlan\n\n private copied = false\n\n constructor(options: CesiumAssetsOptions = {}) {\n this.plan = planCesiumAssets(options)\n }\n\n apply(compiler: Compiler): void {\n const publicPath = resolvePublicPath(compiler.options.output.publicPath, this.plan.dir)\n // Off the compiler: getCompilationHooks rejects a compilation from a different instance.\n const { HtmlRspackPlugin } = compiler.rspack\n\n // The copy is on disk but the dev server serves from memory, so it needs the source directory.\n compiler.options.devServer = {\n ...compiler.options.devServer,\n static: [\n ...normaliseStatic(compiler.options.devServer?.static),\n { directory: this.plan.source, publicPath: `/${this.plan.dir}` },\n ],\n }\n\n // afterEmit fires per rebuild; the tree is tens of megabytes and never changes within a run.\n compiler.hooks.afterEmit.tap(PLUGIN_NAME, () => {\n if (this.copied) {\n return\n }\n\n copyCesiumAssets(this.plan, compiler.outputPath)\n this.copied = true\n })\n\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n // The hook exists even with no HTML plugin driving it, so absence is otherwise silent.\n if (!hasHtmlPlugin(compiler, HtmlRspackPlugin)) {\n compilation.warnings.push(\n new Error(\n `${PLUGIN_NAME}: HtmlRspackPlugin is required to inject window.CESIUM_BASE_URL. ` +\n `Set it to \"${publicPath}\" yourself if you generate HTML another way.`,\n ),\n )\n\n return\n }\n\n // First in <head> so it runs before any module, beating ensureCesiumBaseUrl()'s default.\n HtmlRspackPlugin.getCompilationHooks(compilation).alterAssetTagGroups.tap(\n PLUGIN_NAME,\n (data) => {\n data.headTags.unshift({\n tagName: 'script',\n voidTag: false,\n attributes: {},\n innerHTML: cesiumBaseUrlScript(publicPath),\n })\n\n return data\n },\n )\n })\n }\n}\n\nfunction hasHtmlPlugin(compiler: Compiler, HtmlRspackPlugin: unknown): boolean {\n const plugins = compiler.options.plugins ?? []\n\n return plugins.some(\n (plugin) =>\n plugin instanceof (HtmlRspackPlugin as new () => object) ||\n plugin?.constructor?.name === 'HtmlRspackPlugin',\n )\n}\n\ntype DevServerStatic = NonNullable<NonNullable<Compiler['options']['devServer']>['static']>\ntype StaticEntry = Extract<DevServerStatic, readonly unknown[]>[number]\n\n// `static` accepts a single entry, an array, or a boolean; only the first two carry entries to keep.\nfunction normaliseStatic(configured: DevServerStatic | undefined): StaticEntry[] {\n if (configured === undefined || typeof configured === 'boolean') {\n return []\n }\n\n return Array.isArray(configured) ? [...configured] : [configured as StaticEntry]\n}\n\n/**\n * `output.publicPath` may be `'auto'` (a bundler marker, not a URL), `''` (deliberately relative to\n * the document) or a function, which cannot be resolved before a compilation exists.\n */\nexport function resolvePublicPath(configured: unknown, dir: string): string {\n if (typeof configured === 'function' || configured === undefined || configured === 'auto') {\n return joinPublicPath('/', dir)\n }\n\n return joinPublicPath(String(configured), dir)\n}\n"],"names":[],"mappings":";;AAUA,MAAM,WAAA,GAAc,0BAAA;AAMb,MAAM,wBAAA,CAAyB;AAAA,EACnB,IAAA;AAAA,EAET,MAAA,GAAS,KAAA;AAAA,EAEjB,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAG;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAiB,OAAO,CAAA;AAAA,EACtC;AAAA,EAEA,MAAM,QAAA,EAA0B;AAC9B,IAAA,MAAM,UAAA,GAAa,kBAAkB,QAAA,CAAS,OAAA,CAAQ,OAAO,UAAA,EAAY,IAAA,CAAK,KAAK,GAAG,CAAA;AAEtF,IAAA,MAAM,EAAE,gBAAA,EAAiB,GAAI,QAAA,CAAS,MAAA;AAGtC,IAAA,QAAA,C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,CAAA;AAED,UAAA,OAAO,IAAA;AAAA,QACT;AAAA,OACF;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF;AAEA,SAAS,aAAA,CAAc,UAAoB,gBAAA,EAAoC;AAC7E,EAAA,MAAM,OAAA,GAAU,QAAA,CAAS,OAAA,CAAQ,OAAA,IAAW,EAAC;AAE7C,EAAA,OAAO,OAAA,CAAQ,IAAA;AAAA,IACb,CAAC,MAAA,KACC,MAAA,YAAmB,gBAAA,IACnB,MAAA,EAAQ,aAAa,IAAA,KAAS;AAAA,GAClC;AACF;AAMA,SAAS,gBAAgB,UAAA,EAAwD;AAC/E,EAAA,IAAI,UAAA,KAAe,MAAA,IAAa,OAAO,UAAA,KAAe,SAAA,EAAW;AAC/D,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,OAAO,KAAA,CAAM,QAAQ,UAAU,CAAA,GAAI,CAAC,GAAG,UAAU,CAAA,GAAI,CAAC,UAAyB,CAAA;AACjF;AAMO,SAAS,iBAAA,CAAkB,YAAqB,GAAA,EAAqB;AAC1E,EAAA,IAAI,OAAO,UAAA,KAAe,UAAA,IAAc,UAAA,KAAe,MAAA,IAAa,eAAe,MAAA,EAAQ;AACzF,IAAA,OAAO,cAAA,CAAe,KAAK,GAAG,CAAA;AAAA,EAChC;AAEA,EAAA,OAAO,cAAA,CAAe,MAAA,CAAO,UAAU,CAAA,EAAG,GAAG,CAAA;AAC/C;;;;"}
1
+ {"version":3,"file":"rspack-plugin.js","sources":["../src/rspack-plugin.ts"],"sourcesContent":["import type { Compiler } from '@rspack/core'\n\nimport type { CesiumAssetPlan, CesiumAssetsOptions } from './cesiumAssets'\nimport {\n cesiumBaseUrlMeta,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nconst PLUGIN_NAME = 'CesiumAssetsRspackPlugin'\n\n/**\n * Copies Cesium's runtime assets (workers, textures, widget CSS) into the compilation output,\n * serves them in dev, and injects `window.CESIUM_BASE_URL` into the HTML HtmlRspackPlugin emits.\n */\nexport class CesiumAssetsRspackPlugin {\n private readonly plan: CesiumAssetPlan\n\n private copied = false\n\n constructor(options: CesiumAssetsOptions = {}) {\n this.plan = planCesiumAssets(options)\n }\n\n apply(compiler: Compiler): void {\n const publicPath = resolvePublicPath(compiler.options.output.publicPath, this.plan.dir)\n // Off the compiler: getCompilationHooks rejects a compilation from a different instance.\n const { HtmlRspackPlugin } = compiler.rspack\n\n // The copy is on disk but the dev server serves from memory, so it needs the source directory.\n compiler.options.devServer = {\n ...compiler.options.devServer,\n static: [\n ...normaliseStatic(compiler.options.devServer?.static),\n { directory: this.plan.source, publicPath: `/${this.plan.dir}` },\n ],\n }\n\n // afterEmit fires per rebuild; the tree is tens of megabytes and never changes within a run.\n compiler.hooks.afterEmit.tap(PLUGIN_NAME, () => {\n if (this.copied) {\n return\n }\n\n copyCesiumAssets(this.plan, compiler.outputPath)\n this.copied = true\n })\n\n compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n // The hook exists even with no HTML plugin driving it, so absence is otherwise silent.\n if (!hasHtmlPlugin(compiler, HtmlRspackPlugin)) {\n compilation.warnings.push(\n new Error(\n `${PLUGIN_NAME}: HtmlRspackPlugin is required to inject the Cesium base URL meta tag. ` +\n `Set it to \"${publicPath}\" yourself if you generate HTML another way.`,\n ),\n )\n\n return\n }\n\n // First in <head> so it is parsed before any module, beating ensureCesiumBaseUrl()'s default.\n HtmlRspackPlugin.getCompilationHooks(compilation).alterAssetTagGroups.tap(\n PLUGIN_NAME,\n (data) => {\n data.headTags.unshift({\n tagName: 'meta',\n voidTag: true,\n attributes: { ...cesiumBaseUrlMeta(publicPath) },\n })\n\n return data\n },\n )\n })\n }\n}\n\nfunction hasHtmlPlugin(compiler: Compiler, HtmlRspackPlugin: unknown): boolean {\n const plugins = compiler.options.plugins ?? []\n\n return plugins.some(\n (plugin) =>\n plugin instanceof (HtmlRspackPlugin as new () => object) ||\n plugin?.constructor?.name === 'HtmlRspackPlugin',\n )\n}\n\ntype DevServerStatic = NonNullable<NonNullable<Compiler['options']['devServer']>['static']>\ntype StaticEntry = Extract<DevServerStatic, readonly unknown[]>[number]\n\n// `static` accepts a single entry, an array, or a boolean; only the first two carry entries to keep.\nfunction normaliseStatic(configured: DevServerStatic | undefined): StaticEntry[] {\n if (configured === undefined || typeof configured === 'boolean') {\n return []\n }\n\n return Array.isArray(configured) ? [...configured] : [configured as StaticEntry]\n}\n\n/**\n * `output.publicPath` may be `'auto'` (a bundler marker, not a URL), `''` (deliberately relative to\n * the document) or a function, which cannot be resolved before a compilation exists.\n */\nexport function resolvePublicPath(configured: unknown, dir: string): string {\n if (typeof configured === 'function' || configured === undefined || configured === 'auto') {\n return joinPublicPath('/', dir)\n }\n\n return joinPublicPath(String(configured), dir)\n}\n"],"names":[],"mappings":";;AAUA,MAAM,WAAA,GAAc,0BAAA;AAMb,MAAM,wBAAA,CAAyB;AAAA,EACnB,IAAA;AAAA,EAET,MAAA,GAAS,KAAA;AAAA,EAEjB,WAAA,CAAY,OAAA,GAA+B,EAAC,EAAG;AAC7C,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAiB,OAAO,CAAA;AAAA,EACtC;AAAA,EAEA,MAAM,QAAA,EAA0B;AAC9B,IAAA,MAAM,UAAA,GAAa,kBAAkB,QAAA,CAAS,OAAA,CAAQ,OAAO,UAAA,EAAY,IAAA,CAAK,KAAK,GAAG,CAAA;AAEtF,IAAA,MAAM,EAAE,gBAAA,EAAiB,GAAI,QAAA,CAAS,MAAA;AAGtC,IAAA,QAAA,CAAS,QAAQ,SAAA,GAAY;AAAA,MAC3B,GAAG,SAAS,OAAA,CAAQ,SAAA;AAAA,MACpB,MAAA,EAAQ;AAAA,QACN,GAAG,eAAA,CAAgB,QAAA,CAAS,OAAA,CAAQ,WAAW,MAAM,CAAA;AAAA,QACrD,EAAE,SAAA,EAAW,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,YAAY,CAAA,CAAA,EAAI,IAAA,CA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AAA,KACC,MAAA,YAAmB,gBAAA,IACnB,MAAA,EAAQ,aAAa,IAAA,KAAS;AAAA,GAClC;AACF;AAMA,SAAS,gBAAgB,UAAA,EAAwD;AAC/E,EAAA,IAAI,UAAA,KAAe,MAAA,IAAa,OAAO,UAAA,KAAe,SAAA,EAAW;AAC/D,IAAA,OAAO,EAAC;AAAA,EACV;AAEA,EAAA,OAAO,KAAA,CAAM,QAAQ,UAAU,CAAA,GAAI,CAAC,GAAG,UAAU,CAAA,GAAI,CAAC,UAAyB,CAAA;AACjF;AAMO,SAAS,iBAAA,CAAkB,YAAqB,GAAA,EAAqB;AAC1E,EAAA,IAAI,OAAO,UAAA,KAAe,UAAA,IAAc,UAAA,KAAe,MAAA,IAAa,eAAe,MAAA,EAAQ;AACzF,IAAA,OAAO,cAAA,CAAe,KAAK,GAAG,CAAA;AAAA,EAChC;AAEA,EAAA,OAAO,cAAA,CAAe,MAAA,CAAO,UAAU,CAAA,EAAG,GAAG,CAAA;AAC/C;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { resolve } from 'node:path';
2
2
  import sirv from 'sirv';
3
- import { planCesiumAssets, copyCesiumAssets, cesiumBaseUrlScript, joinPublicPath } from './cesiumAssets.js';
3
+ import { planCesiumAssets, copyCesiumAssets, cesiumBaseUrlMeta, joinPublicPath } from './cesiumAssets.js';
4
4
 
5
5
  function devMountPath(publicPath) {
6
6
  const origin = /^[a-z][a-z0-9+.-]*:\/\/[^/]*/i.exec(publicPath)?.[0] ?? "";
@@ -20,13 +20,13 @@ function cesiumAssets(options = {}) {
20
20
  configureServer(server) {
21
21
  server.middlewares.use(devMountPath(publicPath), sirv(plan.source, { dev: true }));
22
22
  },
23
- // In <head> so it runs before any module, beating ensureCesiumBaseUrl()'s default.
23
+ // In <head> so it is parsed before any module, beating ensureCesiumBaseUrl()'s default.
24
24
  transformIndexHtml() {
25
25
  return [
26
26
  {
27
- tag: "script",
27
+ tag: "meta",
28
28
  injectTo: "head-prepend",
29
- children: cesiumBaseUrlScript(publicPath)
29
+ attrs: { ...cesiumBaseUrlMeta(publicPath) }
30
30
  }
31
31
  ];
32
32
  },
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.js","sources":["../src/vite-plugin.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport sirv from 'sirv'\nimport type { Plugin, ResolvedConfig } from 'vite'\n\nimport type { CesiumAssetsOptions } from './cesiumAssets'\nimport {\n cesiumBaseUrlScript,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nexport type { CesiumAssetsOptions }\n\n// Runs before Vite strips `base`, so the mount has to carry it. A CDN base has no local path.\nfunction devMountPath(publicPath: string): string {\n const origin = /^[a-z][a-z0-9+.-]*:\\/\\/[^/]*/i.exec(publicPath)?.[0] ?? ''\n const path = publicPath.slice(origin.length)\n\n return path.startsWith('/') ? path : `/${path}`\n}\n\n/**\n * Serves Cesium's runtime assets (workers, textures, widget CSS) in dev and copies them into a\n * version-prefixed directory on build, so the directory can be cached immutably.\n */\nexport function cesiumAssets(options: CesiumAssetsOptions = {}): Plugin {\n const plan = planCesiumAssets(options)\n\n let outDir: string\n let publicPath: string\n\n return {\n name: 'cesium-assets',\n configResolved(config: ResolvedConfig) {\n outDir = resolve(config.root, config.build.outDir)\n // Without the base prefix a path-deployed app 404s every worker while the globe still renders.\n publicPath = joinPublicPath(config.base, plan.dir)\n },\n configureServer(server) {\n server.middlewares.use(devMountPath(publicPath), sirv(plan.source, { dev: true }))\n },\n // In <head> so it runs before any module, beating ensureCesiumBaseUrl()'s default.\n transformIndexHtml() {\n return [\n {\n tag: 'script',\n injectTo: 'head-prepend',\n children: cesiumBaseUrlScript(publicPath),\n },\n ]\n },\n writeBundle() {\n copyCesiumAssets(plan, outDir)\n },\n }\n}\n"],"names":[],"mappings":";;;;AAgBA,SAAS,aAAa,UAAA,EAA4B;AAChD,EAAA,MAAM,SAAS,+BAAA,CAAgC,IAAA,CAAK,UAAU,CAAA,GAAI,CAAC,CAAA,IAAK,EAAA;AACxE,EAAA,MAAM,IAAA,GAAO,UAAA,CAAW,KAAA,CAAM,MAAA,CAAO,MAAM,CAAA;AAE3C,EAAA,OAAO,KAAK,UAAA,CAAW,GAAG,CAAA,GAAI,IAAA,GAAO,IAAI,IAAI,CAAA,CAAA;AAC/C;AAMO,SAAS,YAAA,CAAa,OAAA,GAA+B,EAAC,EAAW;AACtE,EAAA,MAAM,IAAA,GAAO,iBAAiB,OAAO,CAAA;AAErC,EAAA,IAAI,MAAA;AACJ,EAAA,IAAI,UAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,eAAe,MAAA,EAAwB;AACrC,MAAA,MAAA,GAAS,OAAA,CAAQ,MAAA,CAAO,IAAA,EAAM,MAAA,CAAO,MAAM,MAAM,CAAA;AAEjD,MAAA,UAAA,GAAa,cAAA,CAAe,MAAA,CAAO,IAAA,EAAM,IAAA,CAAK,GAAG,CAAA;AAAA,IACnD,CAAA;AAAA,IACA,gBAAgB,MAAA,EAAQ;AACtB,MAAA,MAAA,CAAO,WAAA,CAAY,GAAA,CAAI,YAAA,CAAa,UAAU,CAAA,EAAG,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,EAAE,GAAA,EAAK,IAAA,EAAM,CAAC,CAAA;AAAA,IACnF,CAAA;AAAA;AAAA,IAEA,kBAAA,GAAqB;AACnB,MAAA,OAAO;AAAA,QACL;AAAA,UACE,GAAA,EAAK,QAAA;AAAA,UACL,QAAA,EAAU,cAAA;AAAA,UACV,QAAA,EAAU,oBAAoB,UAAU;AAAA;AAC1C,OACF;AAAA,IACF,CAAA;AAAA,IACA,WAAA,GAAc;AACZ,MAAA,gBAAA,CAAiB,MAAM,MAAM,CAAA;AAAA,IAC/B;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"vite-plugin.js","sources":["../src/vite-plugin.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport sirv from 'sirv'\nimport type { Plugin, ResolvedConfig } from 'vite'\n\nimport type { CesiumAssetsOptions } from './cesiumAssets'\nimport {\n cesiumBaseUrlMeta,\n copyCesiumAssets,\n joinPublicPath,\n planCesiumAssets,\n} from './cesiumAssets'\n\nexport type { CesiumAssetsOptions }\n\n// Runs before Vite strips `base`, so the mount has to carry it. A CDN base has no local path.\nfunction devMountPath(publicPath: string): string {\n const origin = /^[a-z][a-z0-9+.-]*:\\/\\/[^/]*/i.exec(publicPath)?.[0] ?? ''\n const path = publicPath.slice(origin.length)\n\n return path.startsWith('/') ? path : `/${path}`\n}\n\n/**\n * Serves Cesium's runtime assets (workers, textures, widget CSS) in dev and copies them into a\n * version-prefixed directory on build, so the directory can be cached immutably.\n */\nexport function cesiumAssets(options: CesiumAssetsOptions = {}): Plugin {\n const plan = planCesiumAssets(options)\n\n let outDir: string\n let publicPath: string\n\n return {\n name: 'cesium-assets',\n configResolved(config: ResolvedConfig) {\n outDir = resolve(config.root, config.build.outDir)\n // Without the base prefix a path-deployed app 404s every worker while the globe still renders.\n publicPath = joinPublicPath(config.base, plan.dir)\n },\n configureServer(server) {\n server.middlewares.use(devMountPath(publicPath), sirv(plan.source, { dev: true }))\n },\n // In <head> so it is parsed before any module, beating ensureCesiumBaseUrl()'s default.\n transformIndexHtml() {\n return [\n {\n tag: 'meta',\n injectTo: 'head-prepend',\n attrs: { ...cesiumBaseUrlMeta(publicPath) },\n },\n ]\n },\n writeBundle() {\n copyCesiumAssets(plan, outDir)\n },\n }\n}\n"],"names":[],"mappings":";;;;AAgBA,SAAS,aAAa,UAAA,EAA4B;AAChD,EAAA,MAAM,SAAS,+BAAA,CAAgC,IAAA,CAAK,UAAU,CAAA,GAAI,CAAC,CAAA,IAAK,EAAA;AACxE,EAAA,MAAM,IAAA,GAAO,UAAA,CAAW,KAAA,CAAM,MAAA,CAAO,MAAM,CAAA;AAE3C,EAAA,OAAO,KAAK,UAAA,CAAW,GAAG,CAAA,GAAI,IAAA,GAAO,IAAI,IAAI,CAAA,CAAA;AAC/C;AAMO,SAAS,YAAA,CAAa,OAAA,GAA+B,EAAC,EAAW;AACtE,EAAA,MAAM,IAAA,GAAO,iBAAiB,OAAO,CAAA;AAErC,EAAA,IAAI,MAAA;AACJ,EAAA,IAAI,UAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,eAAe,MAAA,EAAwB;AACrC,MAAA,MAAA,GAAS,OAAA,CAAQ,MAAA,CAAO,IAAA,EAAM,MAAA,CAAO,MAAM,MAAM,CAAA;AAEjD,MAAA,UAAA,GAAa,cAAA,CAAe,MAAA,CAAO,IAAA,EAAM,IAAA,CAAK,GAAG,CAAA;AAAA,IACnD,CAAA;AAAA,IACA,gBAAgB,MAAA,EAAQ;AACtB,MAAA,MAAA,CAAO,WAAA,CAAY,GAAA,CAAI,YAAA,CAAa,UAAU,CAAA,EAAG,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,EAAE,GAAA,EAAK,IAAA,EAAM,CAAC,CAAA;AAAA,IACnF,CAAA;AAAA;AAAA,IAEA,kBAAA,GAAqB;AACnB,MAAA,OAAO;AAAA,QACL;AAAA,UACE,GAAA,EAAK,MAAA;AAAA,UACL,QAAA,EAAU,cAAA;AAAA,UACV,KAAA,EAAO,EAAE,GAAG,iBAAA,CAAkB,UAAU,CAAA;AAAE;AAC5C,OACF;AAAA,IACF,CAAA;AAAA,IACA,WAAA,GAAc;AACZ,MAAA,gBAAA,CAAiB,MAAM,MAAM,CAAA;AAAA,IAC/B;AAAA,GACF;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xgis/xgis3d-build",
3
- "version": "0.3.23",
3
+ "version": "0.3.35",
4
4
  "description": "Build-tool integration for @xgis/xgis3d — serves and copies CesiumJS runtime assets.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "peerDependencies": {
32
32
  "@rspack/core": "^1.0.0",
33
33
  "vite": "^6.0.0 || ^7.0.0",
34
- "@xgis/xgis3d": "^0.3.23"
34
+ "@xgis/xgis3d": "^0.3.35"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@rspack/core": {
@@ -51,9 +51,9 @@
51
51
  "typescript": "^6.0.3",
52
52
  "vite": "^6.4.3",
53
53
  "vitest": "^4.1.7",
54
- "@xgis/tsconfig": "0.0.0",
55
- "@xgis/xgis3d": "0.3.23",
56
- "@xgis/eslint-config": "0.0.0"
54
+ "@xgis/eslint-config": "0.0.0",
55
+ "@xgis/xgis3d": "0.3.35",
56
+ "@xgis/tsconfig": "0.0.0"
57
57
  },
58
58
  "scripts": {
59
59
  "lint": "eslint src",