@orkestrel/sea 0.0.6 → 0.0.8

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.
@@ -2041,7 +2041,7 @@ var SEA = class {
2041
2041
  this.#check();
2042
2042
  const compression = this.#compress(root);
2043
2043
  this.#check();
2044
- const blob = this.#blob(root);
2044
+ const blob = this.#blob(root, compression);
2045
2045
  this.#check();
2046
2046
  const assembled = this.#assemble(root, blob);
2047
2047
  const size = (0, node_fs.statSync)(assembled.executable).size;
@@ -2136,7 +2136,7 @@ var SEA = class {
2136
2136
  this.#emitter.emit("compress", manifest);
2137
2137
  return manifest;
2138
2138
  }
2139
- #blob(root) {
2139
+ #blob(root, compression) {
2140
2140
  const entry = (0, node_path.resolve)(root, this.#options.entry.path);
2141
2141
  ensureExists(entry, `Entry not found: ${this.#options.entry.path}`, "ENTRY");
2142
2142
  const output = (0, node_path.resolve)(root, this.#options.output);
@@ -2146,7 +2146,7 @@ var SEA = class {
2146
2146
  const config = createBlobConfig({
2147
2147
  path: entry,
2148
2148
  ...this.#options.entry.format === void 0 ? {} : { format: this.#options.entry.format }
2149
- }, blob, this.#assets(root), this.#options.blob);
2149
+ }, blob, this.#assets(root, compression), this.#options.blob);
2150
2150
  (0, node_fs.writeFileSync)(configPath, JSON.stringify(config, null, 2));
2151
2151
  runShell([
2152
2152
  process.execPath,
@@ -2274,9 +2274,14 @@ var SEA = class {
2274
2274
  ...terminal === void 0 ? {} : { terminal }
2275
2275
  };
2276
2276
  }
2277
- #assets(root) {
2277
+ #assets(root, compression) {
2278
+ const outputs = /* @__PURE__ */ new Map();
2279
+ for (const result of compression?.assets ?? []) outputs.set(result.input, result.output);
2278
2280
  const assets = {};
2279
- for (const [name, path] of Object.entries(this.#options.assets ?? {})) assets[name] = ensureContained(root, path);
2281
+ for (const [name, path] of Object.entries(this.#options.assets ?? {})) {
2282
+ const input = ensureContained(root, path);
2283
+ assets[name] = outputs.get(input) ?? input;
2284
+ }
2280
2285
  return assets;
2281
2286
  }
2282
2287
  };