@sanity/pkg-utils 2.3.13-canary.1 → 2.3.14

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/dist/index.js CHANGED
@@ -32,7 +32,6 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
32
32
  import replace from '@rollup/plugin-replace';
33
33
  import terser from '@rollup/plugin-terser';
34
34
  import esbuild from 'rollup-plugin-esbuild';
35
- import preserveDirectives from 'rollup-plugin-preserve-directives';
36
35
  import esbuild$1 from 'esbuild';
37
36
  import treeify from 'treeify';
38
37
  import prettyBytes from 'pretty-bytes';
@@ -1458,10 +1457,10 @@ function resolveRollupConfig(ctx, buildTask) {
1458
1457
  modules: false
1459
1458
  }]]
1460
1459
  }), minify && terser({
1461
- compress: (config == null ? void 0 : config.preserveModuleDirectives) ? {
1460
+ compress: {
1462
1461
  // Needed until https://github.com/terser/terser/issues/1320 is fixed
1463
1462
  directives: false
1464
- } : true,
1463
+ },
1465
1464
  output: {
1466
1465
  comments: (_node, comment) => {
1467
1466
  const text = comment.value;
@@ -1472,9 +1471,7 @@ function resolveRollupConfig(ctx, buildTask) {
1472
1471
  return false;
1473
1472
  }
1474
1473
  }
1475
- }),
1476
- // Allows marking export files with `'use client'` at the top
1477
- (config == null ? void 0 : config.preserveModuleDirectives) && preserveDirectives()].filter(Boolean);
1474
+ })].filter(Boolean);
1478
1475
  const userPlugins = (_c = config == null ? void 0 : config.rollup) == null ? void 0 : _c.plugins;
1479
1476
  const plugins = Array.isArray(userPlugins) ? defaultPlugins.concat(userPlugins) : resolveConfigProperty((_d = config == null ? void 0 : config.rollup) == null ? void 0 : _d.plugins, defaultPlugins);
1480
1477
  return {
@@ -1531,8 +1528,7 @@ function resolveRollupConfig(ctx, buildTask) {
1531
1528
  interop: "compat",
1532
1529
  minifyInternalExports: minify,
1533
1530
  sourcemap: (_ref11 = config == null ? void 0 : config.sourcemap) !== null && _ref11 !== void 0 ? _ref11 : true,
1534
- hoistTransitiveImports: false,
1535
- preserveModules: (config == null ? void 0 : config.preserveModuleDirectives) ? true : false
1531
+ hoistTransitiveImports: false
1536
1532
  }
1537
1533
  };
1538
1534
  }
@@ -1598,19 +1594,6 @@ async function execPromise(ctx, task) {
1598
1594
  const bundle = await rollup({
1599
1595
  ...inputOptions,
1600
1596
  onwarn(warning) {
1601
- var _a;
1602
- if (
1603
- // Ignore the directive warning until the preserveDirectives plugin does it automatically: https://github.com/Ephem/rollup-plugin-preserve-directives#rollup-plugin-preserve-directives-warning
1604
- warning.message.includes('Module level directives cause errors when bundled, "use client" in')) {
1605
- if (!((_a = ctx.config) == null ? void 0 : _a.preserveModuleDirectives)) {
1606
- consoleSpy.messages.push({
1607
- type: "warn",
1608
- code: warning.code,
1609
- args: ["".concat(warning.message, " You can preserve it by setting \"preserveModuleDirectives: true\" in your \"package.config.ts\"")]
1610
- });
1611
- }
1612
- return;
1613
- }
1614
1597
  consoleSpy.messages.push({
1615
1598
  type: "warn",
1616
1599
  code: warning.code,