@sanity/tsdown-config 0.7.2 → 0.7.3
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.mjs +3 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -9
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineConfig as defineConfig$1 } from "tsdown";
|
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
function defineConfig(options = {}) {
|
|
6
|
-
let { entry } = options;
|
|
6
|
+
let { entry } = options, tsconfig = options.tsconfig ?? "tsconfig.json", platform = options.platform ?? "neutral";
|
|
7
7
|
return defineConfig$1({
|
|
8
8
|
entry,
|
|
9
9
|
exports: {
|
|
@@ -17,25 +17,14 @@ function defineConfig(options = {}) {
|
|
|
17
17
|
experimental: { attachDebugInfo: "none" }
|
|
18
18
|
},
|
|
19
19
|
outputOptions: { hoistTransitiveImports: !1 },
|
|
20
|
-
platform
|
|
20
|
+
platform,
|
|
21
21
|
publint: !0,
|
|
22
22
|
report: { gzip: !1 },
|
|
23
|
-
tsconfig
|
|
23
|
+
tsconfig,
|
|
24
24
|
minify: {
|
|
25
25
|
compress: !0,
|
|
26
26
|
codegen: !1,
|
|
27
27
|
mangle: !1
|
|
28
|
-
},
|
|
29
|
-
treeshake: {
|
|
30
|
-
annotations: !0,
|
|
31
|
-
propertyReadSideEffects: !1,
|
|
32
|
-
moduleSideEffects: [{
|
|
33
|
-
test: /\.css$/,
|
|
34
|
-
sideEffects: !0
|
|
35
|
-
}, {
|
|
36
|
-
external: !0,
|
|
37
|
-
sideEffects: !1
|
|
38
|
-
}]
|
|
39
28
|
}
|
|
40
29
|
});
|
|
41
30
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["defineTsdownConfig"],"sources":["../src/index.ts"],"sourcesContent":["import {defineConfig as defineTsdownConfig, type UserConfig} from 'tsdown'\n\n/**\n * @public\n */\nexport interface PackageOptions extends Pick<UserConfig, 'tsconfig' | 'entry' | 'format'> {\n /**\n * @defaultValue 'neutral'\n */\n platform?: UserConfig['platform']\n}\n\n/**\n * @public\n */\nexport function defineConfig(options: PackageOptions = {}): UserConfig {\n const {entry} = options\n const tsconfig = options.tsconfig ?? 'tsconfig.json'\n const platform = options.platform ?? 'neutral'\n const report = {gzip: false} as const satisfies UserConfig['report']\n const publint = true\n const hash = false\n const format = options.format ?? 'esm'\n const inputOptions = {\n preserveEntrySignatures: 'strict',\n experimental: {attachDebugInfo: 'none'},\n } as const satisfies UserConfig['inputOptions']\n const outputOptions = {\n hoistTransitiveImports: false,\n } as const satisfies UserConfig['outputOptions']\n const exports = {\n enabled: 'local-only',\n // @TODO use @sanity/parse-package-json to determine if devExports should be `true` or `source`\n devExports: true,\n } as const satisfies UserConfig['exports']\n\n return defineTsdownConfig({\n entry,\n exports,\n format,\n hash,\n inputOptions,\n outputOptions,\n platform,\n publint,\n report,\n tsconfig,\n minify: {compress: true, codegen: false, mangle: false},\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["defineTsdownConfig"],"sources":["../src/index.ts"],"sourcesContent":["import {defineConfig as defineTsdownConfig, type UserConfig} from 'tsdown'\n\n/**\n * @public\n */\nexport interface PackageOptions extends Pick<UserConfig, 'tsconfig' | 'entry' | 'format'> {\n /**\n * @defaultValue 'neutral'\n */\n platform?: UserConfig['platform']\n}\n\n/**\n * @public\n */\nexport function defineConfig(options: PackageOptions = {}): UserConfig {\n const {entry} = options\n const tsconfig = options.tsconfig ?? 'tsconfig.json'\n const platform = options.platform ?? 'neutral'\n const report = {gzip: false} as const satisfies UserConfig['report']\n const publint = true\n const hash = false\n const format = options.format ?? 'esm'\n const inputOptions = {\n preserveEntrySignatures: 'strict',\n experimental: {attachDebugInfo: 'none'},\n } as const satisfies UserConfig['inputOptions']\n const outputOptions = {\n hoistTransitiveImports: false,\n } as const satisfies UserConfig['outputOptions']\n const exports = {\n enabled: 'local-only',\n // @TODO use @sanity/parse-package-json to determine if devExports should be `true` or `source`\n devExports: true,\n } as const satisfies UserConfig['exports']\n\n return defineTsdownConfig({\n entry,\n exports,\n format,\n hash,\n inputOptions,\n outputOptions,\n platform,\n publint,\n report,\n tsconfig,\n minify: {compress: true, codegen: false, mangle: false},\n // Rely on tsdown's/rolldown's default tree-shaking (`moduleSideEffects: true`) rather than\n // customizing it. Previously this set the equivalent of `moduleSideEffects: 'no-external'`\n // (with a `.css` exemption), which stripped intentional side-effect-only imports of external\n // packages (e.g. `import 'react-time-ago/locale/en'`) from the output. The default preserves\n // those imports while still honoring `package.json` `sideEffects` fields for bundled modules.\n })\n}\n"],"mappings":";;;;AAeA,SAAgB,aAAa,UAA0B,CAAC,GAAe;CACrE,IAAM,EAAC,UAAS,SACV,WAAW,QAAQ,YAAY,iBAC/B,WAAW,QAAQ,YAAY;CAkBrC,OAAOA,eAAmB;EACxB;EACA,SAAA;GAPA,SAAS;GAET,YAAY;EAKN;EACN,QAjBa,QAAQ,UAAU;EAkB/B,MAAA;EACA,cAAA;GAjBA,yBAAyB;GACzB,cAAc,EAAC,iBAAiB,OAAM;EAgB3B;EACX,eAAA,EAdA,wBAAwB,GAcZ;EACZ;EACA,SAAA;EACA,QAAA,EA1Bc,MAAM,GA0Bf;EACL;EACA,QAAQ;GAAC,UAAU;GAAM,SAAS;GAAO,QAAQ;EAAK;CAMxD,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/tsdown-config",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Shared configuration for tsdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity-io",
|
|
@@ -30,24 +30,21 @@
|
|
|
30
30
|
".": "./dist/index.mjs",
|
|
31
31
|
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
|
-
"main": "./dist/index.mjs",
|
|
34
|
-
"module": "./dist/index.mjs",
|
|
35
33
|
"types": "./dist/index.d.mts",
|
|
36
34
|
"files": [
|
|
37
35
|
"dist"
|
|
38
36
|
],
|
|
39
37
|
"dependencies": {
|
|
40
|
-
"publint": "^0.3.21"
|
|
41
|
-
"@sanity/parse-package-json": "^2.1.7"
|
|
38
|
+
"publint": "^0.3.21"
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
41
|
"@typescript/native-preview": "7.0.0-dev.20260421.2",
|
|
45
42
|
"tinyexec": "^1.2.4",
|
|
46
|
-
"tsdown": "^0.22.
|
|
43
|
+
"tsdown": "^0.22.3",
|
|
47
44
|
"typescript": "6.0.3",
|
|
48
|
-
"vitest": "^4.1.
|
|
49
|
-
"@sanity/
|
|
50
|
-
"@sanity/
|
|
45
|
+
"vitest": "^4.1.9",
|
|
46
|
+
"@sanity/tsconfig": "^2.1.0",
|
|
47
|
+
"@sanity/pkg-utils": "^10.8.2"
|
|
51
48
|
},
|
|
52
49
|
"peerDependencies": {
|
|
53
50
|
"tsdown": "0.22.x",
|