@powerlines/plugin-tsdown 0.1.280 → 0.1.282
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/helpers/index.cjs +2 -2
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/resolve-options.cjs +1 -1
- package/dist/helpers/resolve-options.mjs +1 -1
- package/dist/helpers/unplugin.cjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{resolve-options-CSWiRNVz.mjs → resolve-options-DDaVMiLp.mjs} +2 -2
- package/dist/{resolve-options-CSWiRNVz.mjs.map → resolve-options-DDaVMiLp.mjs.map} +1 -1
- package/dist/{resolve-options-D2gIEZW3.cjs → resolve-options-DTgEZjex.cjs} +1 -1
- package/dist/{unplugin-8qvZ1vSF.cjs → unplugin-eB0aEKY5.cjs} +1 -1
- package/package.json +4 -4
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_resolve_options = require('../resolve-options-
|
|
2
|
-
const require_unplugin = require('../unplugin-
|
|
1
|
+
const require_resolve_options = require('../resolve-options-DTgEZjex.cjs');
|
|
2
|
+
const require_unplugin = require('../unplugin-eB0aEKY5.cjs');
|
|
3
3
|
require('../helpers-yB1XkvQI.cjs');
|
|
4
4
|
|
|
5
5
|
exports.DEFAULT_TSDOWN_CONFIG = require_resolve_options.DEFAULT_TSDOWN_CONFIG;
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-
|
|
1
|
+
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-DDaVMiLp.mjs";
|
|
2
2
|
import { t as createTsdownPlugin } from "../unplugin-kYkLMXDM.mjs";
|
|
3
3
|
import "../helpers-C9XSjwSZ.mjs";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_options = require('../resolve-options-
|
|
1
|
+
const require_resolve_options = require('../resolve-options-DTgEZjex.cjs');
|
|
2
2
|
|
|
3
3
|
exports.DEFAULT_TSDOWN_CONFIG = require_resolve_options.DEFAULT_TSDOWN_CONFIG;
|
|
4
4
|
exports.resolveFormat = require_resolve_options.resolveFormat;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-
|
|
1
|
+
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "../resolve-options-DDaVMiLp.mjs";
|
|
2
2
|
|
|
3
3
|
export { DEFAULT_TSDOWN_CONFIG, resolveFormat, resolveFromFormat, resolveOptions };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_resolve_options = require('./resolve-options-
|
|
3
|
-
const require_unplugin = require('./unplugin-
|
|
2
|
+
const require_resolve_options = require('./resolve-options-DTgEZjex.cjs');
|
|
3
|
+
const require_unplugin = require('./unplugin-eB0aEKY5.cjs');
|
|
4
4
|
require('./helpers-yB1XkvQI.cjs');
|
|
5
5
|
let __powerlines_core_plugin_utils_format_package_json = require("@powerlines/core/plugin-utils/format-package-json");
|
|
6
6
|
let defu = require("defu");
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "./resolve-options-
|
|
1
|
+
import { i as resolveOptions, n as resolveFormat, r as resolveFromFormat, t as DEFAULT_TSDOWN_CONFIG } from "./resolve-options-DDaVMiLp.mjs";
|
|
2
2
|
import { t as createTsdownPlugin } from "./unplugin-kYkLMXDM.mjs";
|
|
3
3
|
import "./helpers-C9XSjwSZ.mjs";
|
|
4
4
|
import { formatPackageJson } from "@powerlines/core/plugin-utils/format-package-json";
|
|
@@ -95,7 +95,7 @@ function resolveOptions(context) {
|
|
|
95
95
|
define: context.config.define,
|
|
96
96
|
inputOptions: { transform: { inject: context.config.inject } },
|
|
97
97
|
platform: context.config.platform,
|
|
98
|
-
dts:
|
|
98
|
+
dts: context.config.output.dts,
|
|
99
99
|
outDir: appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
|
|
100
100
|
tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
101
101
|
format: resolveFormat(context.config.output.format).filter(Boolean),
|
|
@@ -120,4 +120,4 @@ function resolveOptions(context) {
|
|
|
120
120
|
|
|
121
121
|
//#endregion
|
|
122
122
|
export { resolveOptions as i, resolveFormat as n, resolveFromFormat as r, DEFAULT_TSDOWN_CONFIG as t };
|
|
123
|
-
//# sourceMappingURL=resolve-options-
|
|
123
|
+
//# sourceMappingURL=resolve-options-DDaVMiLp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options-CSWiRNVz.mjs","names":["DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions>"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport { RolldownPluginResolvedConfig } from \"@powerlines/plugin-rolldown/types/plugin\";\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { UserConfig as BuildOptions, Format as TsdownFormat } from \"tsdown\";\nimport { TsdownPluginResolvedConfig } from \"../types/plugin\";\n\nexport const DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions> = {\n platform: \"neutral\",\n target: \"esnext\",\n fixedExtension: true,\n nodeProtocol: true,\n clean: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFormat(formats?: Format | Format[]): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = (context: Context, ...msgs: any[]) =>\n msgs\n .filter(Boolean)\n .join(\" \")\n .replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\")\n .replaceAll(/^\\s+/g, \"\")\n .replaceAll(/\\s+$/g, \"\")\n .trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n const { external, noExternal } = getDependencyConfig(context);\n\n return defu(\n {\n entry:\n context.entry.filter(entry => entry?.file).length > 0\n ? Object.fromEntries(\n context.entry\n .filter(entry => entry?.file)\n .map(entry => [\n entry.output ||\n replaceExtension(\n replacePath(\n replacePath(\n entry.file,\n joinPaths(context.config.root, \"src\")\n ),\n context.entryPath\n )\n ),\n entry.file\n ])\n )\n : [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.ts\"\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.tsx\"\n )\n ],\n external,\n noExternal,\n alias: context.alias,\n resolve: {\n alias: context.alias\n },\n exports:\n (context.config as TsdownPluginResolvedConfig)?.tsdown &&\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n ? defu(\n isSetObject(\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n )\n ? (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n : {},\n {\n customExports: (exports: Record<string, any>) => {\n const result = Object.fromEntries(\n Object.entries(exports).map(([key, value]) => {\n if (isSetString(value)) {\n return [key, value];\n }\n\n const currentExport = {} as Record<string, any>;\n if (isSetString(value.require)) {\n currentExport.require = {\n types: replaceExtension(value.require, \".d.cts\", {\n fullExtension: true\n }),\n default: value.require\n };\n }\n\n if (isSetString(value.import)) {\n currentExport.import = {\n types: replaceExtension(value.import, \".d.mts\", {\n fullExtension: true\n }),\n default: value.import\n };\n }\n\n if (!isSetObject(value.default)) {\n if (isSetObject(currentExport.import)) {\n currentExport.default = currentExport.import;\n } else if (isSetObject(currentExport.require)) {\n currentExport.default = currentExport.require;\n }\n }\n\n return [key, currentExport];\n })\n );\n\n return Object.keys(result)\n .sort()\n .reduce(\n (ret, key) => {\n ret[key] = result[key];\n return ret;\n },\n {} as Record<string, any>\n );\n }\n }\n )\n : undefined\n },\n (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown\n : {},\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? {\n inputOptions: (context.config as RolldownPluginResolvedConfig)\n ?.rolldown\n }\n : {},\n {\n name: context.config.name,\n cwd: appendPath(\n context.config.root,\n context.workspaceConfig.workspaceRoot\n ),\n define: context.config.define,\n inputOptions: {\n transform: {\n inject: context.config.inject\n }\n },\n platform: context.config.platform,\n dts: true,\n outDir: appendPath(\n context.config.output.buildPath,\n context.workspaceConfig.workspaceRoot\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n format: resolveFormat(context.config.output.format).filter(Boolean),\n mode: context.config.mode,\n treeshake: (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown?.treeshake\n : undefined,\n minify: context.config.mode === \"production\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n logLevel:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n customLogger: {\n level:\n context.config.logLevel === \"trace\"\n ? \"debug\"\n : context.config.logLevel,\n info: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.debug(formatMessage(context, ...msgs)),\n warn: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n warnOnce: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n error: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.error(formatMessage(context, ...msgs)),\n success: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/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,cAAc,SAAS,GAAG,KAAK,CAAC;GAChD,UAAU,GAAG,SACX,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,MAAM,cAAc,SAAS,GAAG,KAAK,CAAC;GACjD;EACF,EACD,sBACD"}
|
|
1
|
+
{"version":3,"file":"resolve-options-DDaVMiLp.mjs","names":["DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions>"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { getDependencyConfig } from \"@powerlines/core/plugin-utils\";\nimport { RolldownPluginResolvedConfig } from \"@powerlines/plugin-rolldown/types/plugin\";\nimport type { Format } from \"@storm-software/build-tools/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { UserConfig as BuildOptions, Format as TsdownFormat } from \"tsdown\";\nimport { TsdownPluginResolvedConfig } from \"../types/plugin\";\n\nexport const DEFAULT_TSDOWN_CONFIG: Partial<BuildOptions> = {\n platform: \"neutral\",\n target: \"esnext\",\n fixedExtension: true,\n nodeProtocol: true,\n clean: false\n} as const;\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFormat(formats?: Format | Format[]): TsdownFormat[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n default:\n return \"esm\";\n }\n });\n}\n\n/**\n * Resolves the entry options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param formats - The formats to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveFromFormat(\n formats?: TsdownFormat | TsdownFormat[]\n): Format[] {\n return toArray(formats).map(format => {\n switch (format) {\n case \"cjs\":\n case \"commonjs\":\n return \"cjs\";\n case \"iife\":\n return \"iife\";\n case \"esm\":\n case \"es\":\n case \"module\":\n case \"umd\":\n default:\n return \"esm\";\n }\n });\n}\n\nconst formatMessage = (context: Context, ...msgs: any[]) =>\n msgs\n .filter(Boolean)\n .join(\" \")\n .replace(new RegExp(`\\\\[${context.config.name}\\\\]`, \"g\"), \"\")\n .replaceAll(/^\\s+/g, \"\")\n .replaceAll(/\\s+$/g, \"\")\n .trim();\n\n/**\n * Resolves the options for [tsdown](https://github.com/rolldown/tsdown).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n const { external, noExternal } = getDependencyConfig(context);\n\n return defu(\n {\n entry:\n context.entry.filter(entry => entry?.file).length > 0\n ? Object.fromEntries(\n context.entry\n .filter(entry => entry?.file)\n .map(entry => [\n entry.output ||\n replaceExtension(\n replacePath(\n replacePath(\n entry.file,\n joinPaths(context.config.root, \"src\")\n ),\n context.entryPath\n )\n ),\n entry.file\n ])\n )\n : [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.ts\"\n ),\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"src\",\n \"**/*.tsx\"\n )\n ],\n external,\n noExternal,\n alias: context.alias,\n resolve: {\n alias: context.alias\n },\n exports:\n (context.config as TsdownPluginResolvedConfig)?.tsdown &&\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n ? defu(\n isSetObject(\n (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n )\n ? (context.config as TsdownPluginResolvedConfig).tsdown?.exports\n : {},\n {\n customExports: (exports: Record<string, any>) => {\n const result = Object.fromEntries(\n Object.entries(exports).map(([key, value]) => {\n if (isSetString(value)) {\n return [key, value];\n }\n\n const currentExport = {} as Record<string, any>;\n if (isSetString(value.require)) {\n currentExport.require = {\n types: replaceExtension(value.require, \".d.cts\", {\n fullExtension: true\n }),\n default: value.require\n };\n }\n\n if (isSetString(value.import)) {\n currentExport.import = {\n types: replaceExtension(value.import, \".d.mts\", {\n fullExtension: true\n }),\n default: value.import\n };\n }\n\n if (!isSetObject(value.default)) {\n if (isSetObject(currentExport.import)) {\n currentExport.default = currentExport.import;\n } else if (isSetObject(currentExport.require)) {\n currentExport.default = currentExport.require;\n }\n }\n\n return [key, currentExport];\n })\n );\n\n return Object.keys(result)\n .sort()\n .reduce(\n (ret, key) => {\n ret[key] = result[key];\n return ret;\n },\n {} as Record<string, any>\n );\n }\n }\n )\n : undefined\n },\n (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown\n : {},\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? {\n inputOptions: (context.config as RolldownPluginResolvedConfig)\n ?.rolldown\n }\n : {},\n {\n name: context.config.name,\n cwd: appendPath(\n context.config.root,\n context.workspaceConfig.workspaceRoot\n ),\n define: context.config.define,\n inputOptions: {\n transform: {\n inject: context.config.inject\n }\n },\n platform: context.config.platform,\n dts: context.config.output.dts,\n outDir: appendPath(\n context.config.output.buildPath,\n context.workspaceConfig.workspaceRoot\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n format: resolveFormat(context.config.output.format).filter(Boolean),\n mode: context.config.mode,\n treeshake: (context.config as TsdownPluginResolvedConfig)?.tsdown\n ? (context.config as TsdownPluginResolvedConfig)?.tsdown?.treeshake\n : undefined,\n minify: context.config.mode === \"production\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n debug: context.config.mode === \"development\",\n silent:\n context.config.logLevel === null ||\n context.config.mode === \"production\",\n logLevel:\n context.config.logLevel === \"trace\" ? \"debug\" : context.config.logLevel,\n customLogger: {\n level:\n context.config.logLevel === \"trace\"\n ? \"debug\"\n : context.config.logLevel,\n info: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.debug(formatMessage(context, ...msgs)),\n warn: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n warnOnce: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.warn(formatMessage(context, ...msgs)),\n error: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.error(formatMessage(context, ...msgs)),\n success: (...msgs: any[]) =>\n isSetString(formatMessage(context, ...msgs).replace(/\\s+/g, \"\")) &&\n context.debug(formatMessage(context, ...msgs))\n }\n },\n DEFAULT_TSDOWN_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;;;AAgCA,MAAaA,wBAA+C;CAC1D,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,cAAc;CACd,OAAO;CACR;;;;;;;AAQD,SAAgB,cAAc,SAA6C;AACzE,QAAO,QAAQ,QAAQ,CAAC,KAAI,WAAU;AACpC,UAAQ,QAAR;GACE,KAAK,MACH,QAAO;GACT,KAAK,OACH,QAAO;GACT,KAAK;GACL,QACE,QAAO;;GAEX;;;;;;;;AASJ,SAAgB,kBACd,SACU;AACV,QAAO,QAAQ,QAAQ,CAAC,KAAI,WAAU;AACpC,UAAQ,QAAR;GACE,KAAK;GACL,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O,SAAS;EAClC,WAAW,QAAQ,OAAO,SAAS;EACnC,OAAO,QAAQ,OAAO,SAAS;EAC/B,QACE,QAAQ,OAAO,aAAa,QAC5B,QAAQ,OAAO,SAAS;EAC1B,UACE,QAAQ,OAAO,aAAa,UAAU,UAAU,QAAQ,OAAO;EACjE,cAAc;GACZ,OACE,QAAQ,OAAO,aAAa,UACxB,UACA,QAAQ,OAAO;GACrB,OAAO,GAAG,SACR,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,MAAM,cAAc,SAAS,GAAG,KAAK,CAAC;GAChD,OAAO,GAAG,SACR,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,KAAK,cAAc,SAAS,GAAG,KAAK,CAAC;GAC/C,WAAW,GAAG,SACZ,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,KAAK,cAAc,SAAS,GAAG,KAAK,CAAC;GAC/C,QAAQ,GAAG,SACT,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,MAAM,cAAc,SAAS,GAAG,KAAK,CAAC;GAChD,UAAU,GAAG,SACX,YAAY,cAAc,SAAS,GAAG,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,IAChE,QAAQ,MAAM,cAAc,SAAS,GAAG,KAAK,CAAC;GACjD;EACF,EACD,sBACD"}
|
|
@@ -123,7 +123,7 @@ function resolveOptions(context) {
|
|
|
123
123
|
define: context.config.define,
|
|
124
124
|
inputOptions: { transform: { inject: context.config.inject } },
|
|
125
125
|
platform: context.config.platform,
|
|
126
|
-
dts:
|
|
126
|
+
dts: context.config.output.dts,
|
|
127
127
|
outDir: (0, __stryke_path_append.appendPath)(context.config.output.buildPath, context.workspaceConfig.workspaceRoot),
|
|
128
128
|
tsconfig: (0, __stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
129
129
|
format: resolveFormat(context.config.output.format).filter(Boolean),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_options = require('./resolve-options-
|
|
1
|
+
const require_resolve_options = require('./resolve-options-DTgEZjex.cjs');
|
|
2
2
|
let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
3
3
|
let unplugin = require("unplugin");
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-tsdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.282",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["tsdown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"typings": "dist/index.d.mts",
|
|
74
74
|
"files": ["dist/**/*"],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@powerlines/core": "^0.2.
|
|
77
|
-
"@powerlines/plugin-rolldown": "^0.7.
|
|
76
|
+
"@powerlines/core": "^0.2.15",
|
|
77
|
+
"@powerlines/plugin-rolldown": "^0.7.339",
|
|
78
78
|
"defu": "^6.1.4",
|
|
79
79
|
"unplugin": "^3.0.0"
|
|
80
80
|
},
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"peerDependencies": { "tsdown": ">=0.16.0" },
|
|
83
83
|
"peerDependenciesMeta": { "tsdown": { "optional": false } },
|
|
84
84
|
"publishConfig": { "access": "public" },
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "7496a546473274494be487ebc33cf267ed5cd1f0"
|
|
86
86
|
}
|