@sanity/pkg-utils 7.2.10-canary.0 → 7.2.10-canary.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.
- package/dist/_chunks-cjs/index.cjs +13 -12
- package/dist/_chunks-cjs/index.cjs.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/index.d.cts +0 -36
- package/dist/index.d.ts +0 -36
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/node/tasks/rolldown/resolveRolldownConfig.ts +20 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/pkg-utils",
|
|
3
|
-
"version": "7.2.10-canary.
|
|
3
|
+
"version": "7.2.10-canary.1",
|
|
4
4
|
"description": "Simple utilities for modern npm packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"ts-node": "^10.9.2",
|
|
142
142
|
"typescript": "5.8.3",
|
|
143
143
|
"vitest": "^3.2.4",
|
|
144
|
-
"@sanity/pkg-utils": "7.2.10-canary.
|
|
144
|
+
"@sanity/pkg-utils": "7.2.10-canary.1"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
147
|
"babel-plugin-react-compiler": "*",
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import {optimizeLodashImports} from '@optimize-lodash/rollup-plugin'
|
|
3
|
-
import alias from '@rollup/plugin-alias'
|
|
4
3
|
import {getBabelOutputPlugin} from '@rollup/plugin-babel'
|
|
5
|
-
import commonjs from '@rollup/plugin-commonjs'
|
|
6
|
-
import json from '@rollup/plugin-json'
|
|
7
|
-
import {nodeResolve} from '@rollup/plugin-node-resolve'
|
|
8
4
|
import terser from '@rollup/plugin-terser'
|
|
9
5
|
import type {InputOptions, OutputOptions, Plugin} from 'rolldown'
|
|
10
6
|
import {dts as dtsPlugin} from 'rolldown-plugin-dts'
|
|
@@ -55,16 +51,6 @@ export function resolveRolldownConfig(
|
|
|
55
51
|
|
|
56
52
|
// @ts-expect-error - TODO: fix this
|
|
57
53
|
const _defaultPlugins = [
|
|
58
|
-
alias({
|
|
59
|
-
entries: {...pathAliases},
|
|
60
|
-
}),
|
|
61
|
-
nodeResolve({
|
|
62
|
-
browser: runtime === 'browser',
|
|
63
|
-
extensions: ['.cjs', '.mjs', '.js', '.jsx', '.json', '.node'],
|
|
64
|
-
preferBuiltins: true,
|
|
65
|
-
}),
|
|
66
|
-
commonjs(),
|
|
67
|
-
json(),
|
|
68
54
|
esbuild({
|
|
69
55
|
target,
|
|
70
56
|
tsconfig: ctx.ts.configPath || 'tsconfig.json',
|
|
@@ -138,6 +124,26 @@ export function resolveRolldownConfig(
|
|
|
138
124
|
...replacements,
|
|
139
125
|
},
|
|
140
126
|
|
|
127
|
+
platform:
|
|
128
|
+
buildTask.type === 'rolldown:dts'
|
|
129
|
+
? 'node'
|
|
130
|
+
: runtime === 'node'
|
|
131
|
+
? 'node'
|
|
132
|
+
: runtime === 'browser'
|
|
133
|
+
? 'browser'
|
|
134
|
+
: 'neutral',
|
|
135
|
+
|
|
136
|
+
resolve: {
|
|
137
|
+
alias: pathAliases,
|
|
138
|
+
tsconfigFilename: ctx.ts.configPath || 'tsconfig.json',
|
|
139
|
+
},
|
|
140
|
+
transform: {
|
|
141
|
+
target,
|
|
142
|
+
},
|
|
143
|
+
experimental: {
|
|
144
|
+
attachDebugInfo: 'none',
|
|
145
|
+
},
|
|
146
|
+
|
|
141
147
|
external: (id, importer) => {
|
|
142
148
|
// Check if the id is a self-referencing import
|
|
143
149
|
if (exportIds?.includes(id)) {
|