@sanity/pkg-utils 5.1.10 → 5.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/pkg-utils",
3
- "version": "5.1.10",
3
+ "version": "5.1.11",
4
4
  "description": "Simple utilities for modern npm packages.",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -132,7 +132,7 @@
132
132
  "typescript": "5.4.2",
133
133
  "vitest": "^1.4.0",
134
134
  "vitest-github-actions-reporter": "^0.11.1",
135
- "@sanity/pkg-utils": "5.1.10"
135
+ "@sanity/pkg-utils": "5.1.11"
136
136
  },
137
137
  "peerDependencies": {
138
138
  "typescript": "5.4.2"
@@ -171,8 +171,8 @@ export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
171
171
  // Create rollup bundles that legacy export files will re-export
172
172
  if (config?.legacyExports) {
173
173
  for (const exp of exports) {
174
- const runtime = exp.browser?.import || exp.browser?.require ? 'browser' : ctx.runtime
175
- const output = exp.browser?.import || exp.import || exp.browser?.require || exp.require
174
+ const runtime = exp.browser?.import ? 'browser' : ctx.runtime
175
+ const output = exp.browser?.import || exp.import
176
176
 
177
177
  if (!output) continue
178
178
 
@@ -213,13 +213,7 @@ export function resolveBuildTasks(ctx: BuildContext): BuildTask[] {
213
213
  if (config?.legacyExports) {
214
214
  for (const exp of exports) {
215
215
  if (exp._exported && exp._path !== '.') {
216
- const output = (
217
- exp.browser?.import ||
218
- exp.import ||
219
- exp.browser?.require ||
220
- exp.require ||
221
- ''
222
- ).replace(fileEnding, legacyEnding)
216
+ const output = (exp.browser?.import || exp.import || '').replace(fileEnding, legacyEnding)
223
217
  const relativeTargetPath = output.replace(/\.[^/.]+$/, '')
224
218
 
225
219
  if (relativeTargetPath) {