@sanity/pkg-utils 1.3.0 → 1.3.1

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.
@@ -5496,6 +5496,14 @@ async function build(options) {
5496
5496
  const targetVersions = _parseBrowserslistVersions(pkg.browserslist || _DEFAULTS.browserslist);
5497
5497
  const srcPath = path__default["default"].resolve(cwd, (config == null ? void 0 : config.src) || "src");
5498
5498
  const distPath = path__default["default"].resolve(cwd, (config == null ? void 0 : config.dist) || "dist");
5499
+ const nodeTarget = _parseNodeTarget(targetVersions);
5500
+ const webTarget = _parseWebTarget(targetVersions);
5501
+ if (!nodeTarget) {
5502
+ throw new Error("no matching `node` target");
5503
+ }
5504
+ if (!webTarget) {
5505
+ throw new Error("no matching `web` target");
5506
+ }
5499
5507
  const context = {
5500
5508
  config,
5501
5509
  cwd,
@@ -5506,10 +5514,7 @@ async function build(options) {
5506
5514
  dist: path__default["default"].relative(cwd, distPath),
5507
5515
  pkg,
5508
5516
  src: path__default["default"].relative(cwd, srcPath),
5509
- target: {
5510
- node: _parseNodeTarget(targetVersions) || _DEFAULTS.target.node,
5511
- web: _parseWebTarget(targetVersions) || _DEFAULTS.target.web
5512
- },
5517
+ target: { node: nodeTarget, web: webTarget },
5513
5518
  tsconfig
5514
5519
  };
5515
5520
  console.log(chalk__default["default"].gray("cwd "), context.cwd);
@@ -5541,4 +5546,4 @@ exports._loadPkg = _loadPkg;
5541
5546
  exports._parseExports = _parseExports;
5542
5547
  exports._resolveConfigProperty = _resolveConfigProperty;
5543
5548
  exports.build = build;
5544
- //# sourceMappingURL=_build-f08e1020.cjs.map
5549
+ //# sourceMappingURL=_build-5bf997de.cjs.map