@powerlines/plugin-vite 0.14.300 → 0.14.301
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/build-CKSRktJj.d.mts +13 -0
- package/dist/build-CKSRktJj.d.mts.map +1 -0
- package/dist/build-DJTI0ZMx.cjs +0 -0
- package/dist/build-DVley5x8.d.cts +13 -0
- package/dist/build-DVley5x8.d.cts.map +1 -0
- package/dist/build-D_6wweLB.mjs +1 -0
- package/dist/helpers/index.cjs +6 -5
- package/dist/helpers/index.d.cts +5 -2
- package/dist/helpers/index.d.mts +5 -2
- package/dist/helpers/index.mjs +3 -2
- package/dist/helpers/resolve-options.cjs +3 -70
- package/dist/helpers/resolve-options.d.cts +3 -15
- package/dist/helpers/resolve-options.d.mts +3 -16
- package/dist/helpers/resolve-options.mjs +2 -68
- package/dist/helpers/unplugin.cjs +2 -11
- package/dist/helpers/unplugin.d.cts +4 -8
- package/dist/helpers/unplugin.d.mts +4 -8
- package/dist/helpers/unplugin.mjs +2 -11
- package/dist/helpers-DvTULET6.mjs +1 -0
- package/dist/helpers-yB1XkvQI.cjs +0 -0
- package/dist/index-B8OHl-c_.d.mts +1 -0
- package/dist/index-C-svZlpj.d.mts +1 -0
- package/dist/index-CFG0_wK4.d.cts +1 -0
- package/dist/index-CtCMUyZA.d.cts +1 -0
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +7 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-CfromG2s.d.cts +22 -0
- package/dist/plugin-CfromG2s.d.cts.map +1 -0
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/plugin-DIEwkIcq.d.mts +22 -0
- package/dist/plugin-DIEwkIcq.d.mts.map +1 -0
- package/dist/plugin-HyYPEfea.mjs +1 -0
- package/dist/resolve-options-CGWH6O9W.cjs +113 -0
- package/dist/resolve-options-CZfGIJwj.mjs +69 -0
- package/dist/resolve-options-CZfGIJwj.mjs.map +1 -0
- package/dist/resolve-options-Cjw3kuSJ.d.cts +15 -0
- package/dist/resolve-options-Cjw3kuSJ.d.cts.map +1 -0
- package/dist/resolve-options-DDD8d7th.d.mts +15 -0
- package/dist/resolve-options-DDD8d7th.d.mts.map +1 -0
- package/dist/types/_internal.d.cts +3 -2
- package/dist/types/_internal.d.cts.map +1 -1
- package/dist/types/_internal.d.mts +3 -2
- package/dist/types/_internal.d.mts.map +1 -1
- package/dist/types/build.cjs +1 -0
- package/dist/types/build.d.cts +2 -13
- package/dist/types/build.d.mts +2 -13
- package/dist/types/build.mjs +2 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +3 -23
- package/dist/types/plugin.d.mts +3 -24
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-Cn_AzV39.mjs +1 -0
- package/dist/types-D208vOSb.cjs +0 -0
- package/dist/unplugin-BIIMkEyS.cjs +16 -0
- package/dist/unplugin-CmW69N5s.mjs +11 -0
- package/dist/unplugin-CmW69N5s.mjs.map +1 -0
- package/dist/unplugin-DIdD8ka4.d.mts +8 -0
- package/dist/unplugin-DIdD8ka4.d.mts.map +1 -0
- package/dist/unplugin-hWdrpmFt.d.cts +8 -0
- package/dist/unplugin-hWdrpmFt.d.cts.map +1 -0
- package/package.json +6 -6
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/core/src/lib/entry.cjs +0 -13
- package/dist/core/src/lib/entry.mjs +0 -15
- package/dist/core/src/lib/logger.cjs +0 -41
- package/dist/core/src/lib/logger.mjs +0 -40
- package/dist/core/src/lib/logger.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/index.cjs +0 -3
- package/dist/core/src/lib/unplugin/index.mjs +0 -5
- package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/plugin.cjs +0 -71
- package/dist/core/src/lib/unplugin/plugin.mjs +0 -71
- package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
- package/dist/core/src/lib/utilities/source-file.cjs +0 -22
- package/dist/core/src/lib/utilities/source-file.mjs +0 -21
- package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
- package/dist/core/src/plugin-utils/paths.cjs +0 -2
- package/dist/core/src/plugin-utils/paths.mjs +0 -4
- package/dist/core/src/types/_internal.d.cts +0 -85
- package/dist/core/src/types/_internal.d.cts.map +0 -1
- package/dist/core/src/types/_internal.d.mts +0 -85
- package/dist/core/src/types/_internal.d.mts.map +0 -1
- package/dist/core/src/types/api.d.cts +0 -103
- package/dist/core/src/types/api.d.cts.map +0 -1
- package/dist/core/src/types/api.d.mts +0 -103
- package/dist/core/src/types/api.d.mts.map +0 -1
- package/dist/core/src/types/commands.d.cts +0 -9
- package/dist/core/src/types/commands.d.cts.map +0 -1
- package/dist/core/src/types/commands.d.mts +0 -10
- package/dist/core/src/types/commands.d.mts.map +0 -1
- package/dist/core/src/types/config.d.cts +0 -552
- package/dist/core/src/types/config.d.cts.map +0 -1
- package/dist/core/src/types/config.d.mts +0 -552
- package/dist/core/src/types/config.d.mts.map +0 -1
- package/dist/core/src/types/context.d.cts +0 -511
- package/dist/core/src/types/context.d.cts.map +0 -1
- package/dist/core/src/types/context.d.mts +0 -511
- package/dist/core/src/types/context.d.mts.map +0 -1
- package/dist/core/src/types/fs.d.cts +0 -487
- package/dist/core/src/types/fs.d.cts.map +0 -1
- package/dist/core/src/types/fs.d.mts +0 -487
- package/dist/core/src/types/fs.d.mts.map +0 -1
- package/dist/core/src/types/hooks.d.cts +0 -99
- package/dist/core/src/types/hooks.d.cts.map +0 -1
- package/dist/core/src/types/hooks.d.mts +0 -99
- package/dist/core/src/types/hooks.d.mts.map +0 -1
- package/dist/core/src/types/index.d.mts +0 -9
- package/dist/core/src/types/plugin.d.cts +0 -204
- package/dist/core/src/types/plugin.d.cts.map +0 -1
- package/dist/core/src/types/plugin.d.mts +0 -204
- package/dist/core/src/types/plugin.d.mts.map +0 -1
- package/dist/core/src/types/tsconfig.d.cts +0 -70
- package/dist/core/src/types/tsconfig.d.cts.map +0 -1
- package/dist/core/src/types/tsconfig.d.mts +0 -70
- package/dist/core/src/types/tsconfig.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.cjs +0 -21
- package/dist/core/src/types/unplugin.d.cts +0 -24
- package/dist/core/src/types/unplugin.d.cts.map +0 -1
- package/dist/core/src/types/unplugin.d.mts +0 -25
- package/dist/core/src/types/unplugin.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.mjs +0 -22
- package/dist/core/src/types/unplugin.mjs.map +0 -1
- package/dist/helpers/resolve-options.d.cts.map +0 -1
- package/dist/helpers/resolve-options.d.mts.map +0 -1
- package/dist/helpers/resolve-options.mjs.map +0 -1
- package/dist/helpers/unplugin.d.cts.map +0 -1
- package/dist/helpers/unplugin.d.mts.map +0 -1
- package/dist/helpers/unplugin.mjs.map +0 -1
- package/dist/plugin-esbuild/src/helpers/resolve-options.cjs +0 -74
- package/dist/plugin-esbuild/src/helpers/resolve-options.mjs +0 -73
- package/dist/plugin-esbuild/src/helpers/resolve-options.mjs.map +0 -1
- package/dist/plugin-rolldown/src/helpers/resolve-options.cjs +0 -122
- package/dist/plugin-rolldown/src/helpers/resolve-options.mjs +0 -117
- package/dist/plugin-rolldown/src/helpers/resolve-options.mjs.map +0 -1
- package/dist/plugin-rollup/src/helpers/resolve-options.cjs +0 -123
- package/dist/plugin-rollup/src/helpers/resolve-options.mjs +0 -116
- package/dist/plugin-rollup/src/helpers/resolve-options.mjs.map +0 -1
- package/dist/types/build.d.cts.map +0 -1
- package/dist/types/build.d.mts.map +0 -1
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts.map +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
|
|
4
|
-
//#region ../core/src/types/tsconfig.d.ts
|
|
5
|
-
type ReflectionMode = "default" | "explicit" | "never";
|
|
6
|
-
type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
12
|
-
* - `minimal` - Only the essential type information is captured.
|
|
13
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
14
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
15
|
-
*/
|
|
16
|
-
type ReflectionLevel = "minimal" | "normal" | "verbose";
|
|
17
|
-
interface DeepkitOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
20
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
21
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
22
|
-
*/
|
|
23
|
-
reflection?: RawReflectionMode;
|
|
24
|
-
/**
|
|
25
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
29
|
-
* - `minimal` - Only the essential type information is captured.
|
|
30
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
31
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
32
|
-
*/
|
|
33
|
-
reflectionLevel?: ReflectionLevel;
|
|
34
|
-
}
|
|
35
|
-
type TSCompilerOptions = CompilerOptions & DeepkitOptions;
|
|
36
|
-
/**
|
|
37
|
-
* The TypeScript compiler configuration.
|
|
38
|
-
*
|
|
39
|
-
* @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
|
|
40
|
-
*/
|
|
41
|
-
interface TSConfig extends Omit<TsConfigJson, "reflection"> {
|
|
42
|
-
/**
|
|
43
|
-
* Either true to activate reflection for all files compiled using this tsconfig,
|
|
44
|
-
* or a list of globs/file paths relative to this tsconfig.json.
|
|
45
|
-
* Globs/file paths can be prefixed with a ! to exclude them.
|
|
46
|
-
*/
|
|
47
|
-
reflection?: RawReflectionMode;
|
|
48
|
-
/**
|
|
49
|
-
* Defines the level of reflection to be used during the transpilation process.
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
|
|
53
|
-
* - `minimal` - Only the essential type information is captured.
|
|
54
|
-
* - `normal` - Additional type information is captured, including some contextual data.
|
|
55
|
-
* - `verbose` - All available type information is captured, including detailed contextual data.
|
|
56
|
-
*/
|
|
57
|
-
reflectionLevel?: ReflectionLevel;
|
|
58
|
-
/**
|
|
59
|
-
* Instructs the TypeScript compiler how to compile `.ts` files.
|
|
60
|
-
*/
|
|
61
|
-
compilerOptions?: TSCompilerOptions;
|
|
62
|
-
}
|
|
63
|
-
type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
|
|
64
|
-
originalTsconfigJson: TsConfigJson;
|
|
65
|
-
tsconfigJson: TSConfig;
|
|
66
|
-
tsconfigFilePath: string;
|
|
67
|
-
};
|
|
68
|
-
//#endregion
|
|
69
|
-
export { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig };
|
|
70
|
-
//# sourceMappingURL=tsconfig.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsconfig.d.mts","names":[],"sources":["../../../../../core/src/types/tsconfig.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,cAAA;KACA,iBAAA,GACR;AAFJ;AACA;AAiBA;AAEA;AAoBA;AAOA;;;;AAsBoB,KAnDR,eAAA,GAmDQ,SAAA,GAAA,QAAA,GAAA,SAAA;AAtBc,UA3BjB,cAAA,CA2BiB;EAAI;AAyBtC;;;;EAEwB,UAAA,CAAA,EAhDT,iBAgDS;;;;;;;;;;oBArCJ;;KAGR,iBAAA,GAAoB,kBAAkB;;;;;;UAOjC,QAAA,SAAiB,KAAK;;;;;;eAMxB;;;;;;;;;;oBAWK;;;;oBAKA;;KAGR,sBAAA,GAAyB,EAAA,CAAG;wBAChB;gBACR"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../core/src/types/unplugin.ts
|
|
3
|
-
const UNPLUGIN_BUILDER_VARIANTS = [
|
|
4
|
-
"rollup",
|
|
5
|
-
"webpack",
|
|
6
|
-
"rspack",
|
|
7
|
-
"vite",
|
|
8
|
-
"esbuild",
|
|
9
|
-
"farm",
|
|
10
|
-
"unloader",
|
|
11
|
-
"rolldown",
|
|
12
|
-
"bun"
|
|
13
|
-
];
|
|
14
|
-
const BUILDER_VARIANTS = [
|
|
15
|
-
...UNPLUGIN_BUILDER_VARIANTS,
|
|
16
|
-
"tsup",
|
|
17
|
-
"tsdown",
|
|
18
|
-
"unbuild"
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { PluginHook } from "./plugin.cjs";
|
|
2
|
-
import { Context } from "./context.cjs";
|
|
3
|
-
import { API } from "./api.cjs";
|
|
4
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
5
|
-
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
6
|
-
|
|
7
|
-
//#region ../core/src/types/unplugin.d.ts
|
|
8
|
-
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
9
|
-
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
10
|
-
type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
|
|
11
|
-
interface UnpluginOptions$1<TContext extends Context = Context> extends UnpluginOptions {
|
|
12
|
-
/**
|
|
13
|
-
* An API object that can be used for inter-plugin communication.
|
|
14
|
-
*
|
|
15
|
-
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
16
|
-
*/
|
|
17
|
-
api: API<TContext["config"]>;
|
|
18
|
-
}
|
|
19
|
-
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TContext>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
20
|
-
handler: infer THandler;
|
|
21
|
-
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] };
|
|
22
|
-
//#endregion
|
|
23
|
-
export { BuilderVariant, InferUnpluginOptions, UnpluginBuilderVariant };
|
|
24
|
-
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../../../../core/src/types/unplugin.ts"],"sourcesContent":[],"mappings":";;;;;;;KA6BY,sBAAA;AAuBA,KAAA,cAAA,GACR,sBAAA,GAAA,MAAsB,GAAA,QAAA,GAAA,SAAA;AAY6B,KAA3C,oBAA2C,CAAA,sBAAA,cAAA,CAAA,GACrD,aADqD,SAAA,MAAA,GAAA,SAAA,GAGjD,aAHiD,SAAA,QAAA,GAAA,UAAA,GAK/C,aAL+C,SAAA,SAAA,GAAA,QAAA,GAO7C,aAP6C;AACrD,UAQe,iBARf,CAAA,iBASiB,OATjB,GAS2B,OAT3B,CAAA,SAUQ,eAVR,CAAA;EAEI;;;;AAMN;EACmB,GAAA,EAOZ,GAPY,CAOR,QAPQ,CAAA,QAAA,CAAA,CAAA;;AAOR,KAGC,oBAHD,CAAA,iBAIQ,OAJR,GAIkB,OAJlB,EAAA,wBAKe,cALf,GAKgC,cALhC,EAAA,yBAMgB,oBANhB,CAMqC,eANrC,CAAA,GAOP,oBAPO,CAOc,eAPd,CAAA,CAAA,GAAA,WAAJ,MASU,QATV,CAUH,iBAVG,CAUa,QAVb,CAAA,CAAA,CAWH,gBAXG,CAAA,IAWkB,QAXlB,CAYH,iBAZG,CAYa,QAZb,CAAA,CAAA,CAaH,gBAbG,CAAA,CAae,IAbf,CAAA,SAAA,KAAA,SAAA,GAAA;EANG,OAAA,EAAA,KAAA,SAAA;AAAmB,CAAA,GAAA,QAAA,UAAA,CAAA,IAAA,EAAA,KAAA,iBAAA,EAAA,GAAA,IAAA,EAAA,KAAA,MAAA,EAAA,GAAA,KAAA,QAAA,IA4BrB,UA5BqB,CAAA,CAAA,IAAA,EA8BX,gBA9BW,GA8BQ,QA9BR,EAAA,GAAA,IAAA,EA+BR,KA/BQ,EAAA,GAgCd,YAhCc,CAgCD,OAhCC,CAAA,EAAA,MAiCb,UAjCa,CAAA,GAmCrB,QAnCqB,CAmCZ,iBAnCY,CAmCI,QAnCJ,CAAA,CAAA,CAmCe,gBAnCf,CAAA,CAmCiC,IAnCjC,CAAA,GAoCvB,QApCuB,CAoCd,iBApCc,CAoCE,QApCF,CAAA,CAAA,CAoCa,gBApCb,CAAA,CAoC+B,IApC/B,CAAA,EAS7B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PluginHook } from "./plugin.mjs";
|
|
2
|
-
import { Context } from "./context.mjs";
|
|
3
|
-
import "./config.mjs";
|
|
4
|
-
import { API } from "./api.mjs";
|
|
5
|
-
import { HookFilter, UnpluginOptions } from "unplugin";
|
|
6
|
-
import { MaybePromise } from "@stryke/types/base";
|
|
7
|
-
|
|
8
|
-
//#region ../core/src/types/unplugin.d.ts
|
|
9
|
-
type UnpluginBuilderVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown" | "bun";
|
|
10
|
-
type BuilderVariant = UnpluginBuilderVariant | "tsup" | "tsdown" | "unbuild";
|
|
11
|
-
type InferUnpluginVariant<TBuildVariant extends BuilderVariant> = TBuildVariant extends "tsup" ? "esbuild" : TBuildVariant extends "tsdown" ? "rolldown" : TBuildVariant extends "unbuild" ? "rollup" : TBuildVariant;
|
|
12
|
-
interface UnpluginOptions$1<TContext extends Context = Context> extends UnpluginOptions {
|
|
13
|
-
/**
|
|
14
|
-
* An API object that can be used for inter-plugin communication.
|
|
15
|
-
*
|
|
16
|
-
* @see https://rollupjs.org/plugin-development/#direct-plugin-communication
|
|
17
|
-
*/
|
|
18
|
-
api: API<TContext["config"]>;
|
|
19
|
-
}
|
|
20
|
-
type InferUnpluginOptions<TContext extends Context = Context, TBuilderVariant extends BuilderVariant = BuilderVariant, TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> = InferUnpluginVariant<TBuilderVariant>> = { [TKey in keyof Required<UnpluginOptions$1<TContext>>[TUnpluginVariant]]?: Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] extends infer THandler | {
|
|
21
|
-
handler: infer THandler;
|
|
22
|
-
} ? THandler extends ((this: infer TOriginalContext, ...args: infer TArgs) => infer TReturn) ? PluginHook<(this: TOriginalContext & TContext, ...args: TArgs) => MaybePromise<TReturn>, keyof HookFilter> : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] : Required<UnpluginOptions$1<TContext>>[TUnpluginVariant][TKey] };
|
|
23
|
-
//#endregion
|
|
24
|
-
export { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginBuilderVariant, UnpluginOptions$1 as UnpluginOptions };
|
|
25
|
-
//# sourceMappingURL=unplugin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../../../../core/src/types/unplugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;KA6BY,sBAAA;AAAA,KAuBA,cAAA,GACR,sBAxB8B,GAAA,MAAA,GAAA,QAAA,GAAA,SAAA;AAoCtB,KAAA,oBAAoB,CAAA,sBAAuB,cAAvB,CAAA,GAC9B,aAD8B,SAAA,MAAA,GAAA,SAAA,GAG1B,aAH0B,SAAA,QAAA,GAAA,UAAA,GAKxB,aALwB,SAAA,SAAA,GAAA,QAAA,GAOtB,aAPsB;AAAuB,UAStC,iBATsC,CAAA,iBAUpC,OAVoC,GAU1B,OAV0B,CAAA,SAW7C,eAX6C,CAAA;EACrD;;;;;EAQe,GAAA,EAQV,GARU,CAQN,QARM,CAAA,QAAe,CAAA,CAAA;;AACH,KAUjB,oBAViB,CAAA,iBAWV,OAXU,GAWA,OAXA,EAAA,wBAYH,cAZG,GAYc,cAZd,EAAA,yBAaF,oBAbE,CAamB,eAbnB,CAAA,GAczB,oBAdyB,CAcJ,eAdI,CAAA,CAAA,GAAA,WAOlB,MASM,QATN,CAUP,iBAVO,CAUS,QAVT,CAAA,CAAA,CAWP,gBAXO,CAAA,IAWc,QAXd,CAYP,iBAZO,CAYS,QAZT,CAAA,CAAA,CAaP,gBAbO,CAAA,CAaW,IAbX,CAAA,SAAA,KAAA,SAAA,GAAA;EAAJ,OAAA,EAAA,KAAA,SAAA;AANG,CAAA,GAAA,QAAA,UAAA,CAAA,IAAA,EAAA,KAAA,iBAAA,EAAA,GAAA,IAAA,EAAA,KAAA,MAAA,EAAA,GAAA,KAAA,QAAA,IA4BF,UA5BE,CAAA,CAAA,IAAA,EA8BQ,gBA9BR,GA8B2B,QA9B3B,EAAA,GAAA,IAAA,EA+BW,KA/BX,EAAA,GAgCK,YAhCL,CAgCkB,OAhClB,CAAA,EAAA,MAiCM,UAjCN,CAAA,GAmCF,QAnCE,CAmCO,iBAnCP,CAmCuB,QAnCvB,CAAA,CAAA,CAmCkC,gBAnClC,CAAA,CAmCoD,IAnCpD,CAAA,GAoCJ,QApCI,CAoCK,iBApCL,CAoCqB,QApCrB,CAAA,CAAA,CAoCgC,gBApChC,CAAA,CAoCkD,IApClD,CAAA,EAAmB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region ../core/src/types/unplugin.ts
|
|
2
|
-
const UNPLUGIN_BUILDER_VARIANTS = [
|
|
3
|
-
"rollup",
|
|
4
|
-
"webpack",
|
|
5
|
-
"rspack",
|
|
6
|
-
"vite",
|
|
7
|
-
"esbuild",
|
|
8
|
-
"farm",
|
|
9
|
-
"unloader",
|
|
10
|
-
"rolldown",
|
|
11
|
-
"bun"
|
|
12
|
-
];
|
|
13
|
-
const BUILDER_VARIANTS = [
|
|
14
|
-
...UNPLUGIN_BUILDER_VARIANTS,
|
|
15
|
-
"tsup",
|
|
16
|
-
"tsdown",
|
|
17
|
-
"unbuild"
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { };
|
|
22
|
-
//# sourceMappingURL=unplugin.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.mjs","names":["UNPLUGIN_BUILDER_VARIANTS: UnpluginBuilderVariant[]","BUILDER_VARIANTS: BuilderVariant[]"],"sources":["../../../../../core/src/types/unplugin.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 type { MaybePromise } from \"@stryke/types/base\";\nimport type {\n UnpluginOptions as BaseUnpluginOptions,\n HookFilter,\n UnpluginContextMeta\n} from \"unplugin\";\nimport type { API } from \"./api\";\nimport type { UserConfig } from \"./config\";\nimport type { Context } from \"./context\";\nimport type { PluginHook } from \"./plugin\";\n\nexport type UnpluginBuilderVariant =\n | \"rollup\"\n | \"webpack\"\n | \"rspack\"\n | \"vite\"\n | \"esbuild\"\n | \"farm\"\n | \"unloader\"\n | \"rolldown\"\n | \"bun\";\n\nexport const UNPLUGIN_BUILDER_VARIANTS: UnpluginBuilderVariant[] = [\n \"rollup\",\n \"webpack\",\n \"rspack\",\n \"vite\",\n \"esbuild\",\n \"farm\",\n \"unloader\",\n \"rolldown\",\n \"bun\"\n] as const;\n\nexport type BuilderVariant =\n | UnpluginBuilderVariant\n | \"tsup\"\n | \"tsdown\"\n | \"unbuild\";\n\nexport const BUILDER_VARIANTS: BuilderVariant[] = [\n ...UNPLUGIN_BUILDER_VARIANTS,\n \"tsup\",\n \"tsdown\",\n \"unbuild\"\n] as const;\n\nexport type InferUnpluginVariant<TBuildVariant extends BuilderVariant> =\n TBuildVariant extends \"tsup\"\n ? \"esbuild\"\n : TBuildVariant extends \"tsdown\"\n ? \"rolldown\"\n : TBuildVariant extends \"unbuild\"\n ? \"rollup\"\n : TBuildVariant;\n\nexport interface UnpluginOptions<\n TContext extends Context = Context\n> extends BaseUnpluginOptions {\n /**\n * An API object that can be used for inter-plugin communication.\n *\n * @see https://rollupjs.org/plugin-development/#direct-plugin-communication\n */\n api: API<TContext[\"config\"]>;\n}\n\nexport type InferUnpluginOptions<\n TContext extends Context = Context,\n TBuilderVariant extends BuilderVariant = BuilderVariant,\n TUnpluginVariant extends InferUnpluginVariant<TBuilderVariant> =\n InferUnpluginVariant<TBuilderVariant>\n> = {\n [TKey in keyof Required<\n UnpluginOptions<TContext>\n >[TUnpluginVariant]]?: Required<\n UnpluginOptions<TContext>\n >[TUnpluginVariant][TKey] extends\n | infer THandler\n | {\n handler: infer THandler;\n }\n ? THandler extends (\n this: infer TOriginalContext,\n ...args: infer TArgs\n ) => infer TReturn\n ? PluginHook<\n (\n this: TOriginalContext & TContext,\n ...args: TArgs\n ) => MaybePromise<TReturn>,\n keyof HookFilter\n >\n : Required<UnpluginOptions<TContext>>[TUnpluginVariant][TKey]\n : Required<UnpluginOptions<TContext>>[TUnpluginVariant][TKey];\n};\n\nexport type UnpluginUserConfig = UserConfig & {\n /**\n * The meta information for the unplugin context\n */\n unplugin: UnpluginContextMeta;\n};\n\nexport type UnpluginFactory<TContext extends Context = Context> = (\n options: Partial<TContext[\"config\"][\"userConfig\"]>,\n meta: UnpluginContextMeta\n) => UnpluginOptions<TContext>;\n"],"mappings":";AAwCA,MAAaA,4BAAsD;CACjE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAQD,MAAaC,mBAAqC;CAChD,GAAG;CACH;CACA;CACA;CACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,qBAAqB,QAAQ;;AAA1C;AAiBA;;;;iBAAgB,cAAA,UAAwB,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;cA4Ba,qBAAqB,QAAQ;;;AAA1C;AAiBA;;;iBAAgB,cAAA,UAAwB,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.mjs","names":["DEFAULT_VITE_CONFIG: Partial<ViteOptions>","resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions"],"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/types\";\nimport { resolveOptions as resolveEsbuildOptions } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { resolveOptions as resolveRolldownOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { VitePluginResolvedConfig } from \"../types\";\nimport { ViteOptions } from \"../types/build\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteOptions> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ViteOptions {\n return defu(\n {\n resolve: {\n alias: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n ),\n dedupe: context.config.resolve.dedupe,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n extensions: context.config.resolve.extensions\n }\n },\n (context.config as VitePluginResolvedConfig).vite\n ? defu(\n (context.config as VitePluginResolvedConfig).vite,\n {\n optimizeDeps:\n (context.config as VitePluginResolvedConfig).vite?.optimizeDeps ??\n {}\n },\n {\n optimizeDeps: {\n extensions: context.config.resolve.extensions\n }\n }\n )\n : {},\n {\n define: context.config.define,\n rootDir: context.fs.existsSync(joinPaths(context.config.root, \"src\"))\n ? joinPaths(context.config.root, \"src\")\n : context.config.root,\n platform: context.config.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n outDir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: resolveEsbuildOptions(context) as ESBuildOptions,\n optimizeDeps: {\n rolldownOptions: resolveRolldownOptions(context),\n rollupOptions: resolveRollupOptions(context),\n esbuildOptions: resolveEsbuildOptions(context)\n },\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n ) as ViteOptions;\n}\n"],"mappings":";;;;;;;AA4BA,MAAaA,sBAA4C;CACvD,SAAS,EACP,YAAY;EAAC;EAAQ;EAAO;EAAQ;EAAO;EAAQ;EAAQ;EAAQ,EACpE;CACD,MAAM,EACJ,WAAW,MACZ;CACD,UAAU;CACV,aAAa;CACd;;;;;;;AAQD,SAAgB,eAAe,SAA+B;AAC5D,QAAO,KACL,EACE,SAAS;EACP,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC,QAClC,KAAK,CAAC,IAAI,UAAU;AACnB,OAAI,CAAC,IAAI,MAAK,MAAK,EAAE,SAAS,GAAG,CAC/B,KAAI,KAAK;IACP,MAAM;IACN,aAAa;IACd,CAAC;OAEF,SAAQ,KACN,8BAA8B,GAAG,2CAClC;AAGH,UAAO;KAET,EAAE,CACH;EACD,QAAQ,QAAQ,OAAO,QAAQ;EAC/B,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACpC,EACF,EACA,QAAQ,OAAoC,OACzC,KACG,QAAQ,OAAoC,MAC7C,EACE,cACG,QAAQ,OAAoC,MAAM,gBACnD,EAAE,EACL,EACD,EACE,cAAc,EACZ,YAAY,QAAQ,OAAO,QAAQ,YACpC,EACF,CACF,GACD,EAAE,EACN;EACE,QAAQ,QAAQ,OAAO;EACvB,SAAS,QAAQ,GAAG,WAAW,UAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,GACjE,UAAU,QAAQ,OAAO,MAAM,MAAM,GACrC,QAAQ,OAAO;EACnB,UAAU,QAAQ,OAAO;EACzB,MACE,QAAQ,OAAO,SAAS,gBAAgB,gBAAgB;EAC1D,UAAU,UAAU,QAAQ,WAAW,OAAO;EAC9C,OAAO;GACL,QAAQ,QAAQ,OAAO,SAAS;GAChC,UAAU,QAAQ,OAAO,SAAS;GAClC,WAAW,QAAQ,OAAO,SAAS;GACnC,QAAQ,QAAQ,OAAO,OAAO;GAC9B,UAAU,QAAQ,SAAS;GAC3B,aAAa,QAAQ,SAAS;GAC/B;EACD,SAASC,iBAAsB,QAAQ;EACvC,cAAc;GACZ,iBAAiBC,iBAAuB,QAAQ;GAChD,eAAeC,iBAAqB,QAAQ;GAC5C,gBAAgBF,iBAAsB,QAAQ;GAC/C;EACD,UAAU,QAAQ,OAAO,YAAY;EACrC,QAAQ,QAAQ,OAAO;EACxB,EACD,oBACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,KAAA,CAAA,cAAA,KAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,gBAAA,UAA0B,oBAAiB,KAAA,CAAA,cAAA,KAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.mjs","names":["createViteUnplugin"],"sources":["../../src/helpers/unplugin.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 { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;;AAsBA,SAAgB,iBAAiB,SAA4B;AAC3D,QAAOA,mBAAmB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
require('../../../core/src/lib/entry.cjs');
|
|
3
|
-
let defu = require("defu");
|
|
4
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
5
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
6
|
-
require("@stryke/path/replace");
|
|
7
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
8
|
-
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
9
|
-
|
|
10
|
-
//#region ../plugin-esbuild/src/helpers/resolve-options.ts
|
|
11
|
-
const DEFAULT_ESBUILD_CONFIG = {
|
|
12
|
-
target: "esnext",
|
|
13
|
-
platform: "neutral",
|
|
14
|
-
format: "esm",
|
|
15
|
-
write: true,
|
|
16
|
-
minify: true,
|
|
17
|
-
sourcemap: false,
|
|
18
|
-
bundle: true,
|
|
19
|
-
treeShaking: true,
|
|
20
|
-
keepNames: true,
|
|
21
|
-
splitting: true,
|
|
22
|
-
logLevel: "silent"
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Resolves the esbuild options.
|
|
26
|
-
*
|
|
27
|
-
* @param context - The build context.
|
|
28
|
-
* @returns The resolved esbuild options.
|
|
29
|
-
*/
|
|
30
|
-
function resolveOptions(context) {
|
|
31
|
-
if (context.config.inject && Object.keys(context.config.inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js"), Object.entries(context.config.inject).map(([key, value]) => {
|
|
32
|
-
if (value) if (Array.isArray(value)) {
|
|
33
|
-
if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
|
|
34
|
-
if (value.length === 1) return `
|
|
35
|
-
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
36
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
37
|
-
else if (value.length > 1) return `
|
|
38
|
-
import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
|
|
39
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
40
|
-
} else if (value.length === 1) return `
|
|
41
|
-
import ${key} from "${value[0]}";
|
|
42
|
-
export { ${key} };`;
|
|
43
|
-
else if (value.length > 1) return `
|
|
44
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
45
|
-
export { ${key} };`;
|
|
46
|
-
} else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
|
|
47
|
-
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
48
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
49
|
-
else return `
|
|
50
|
-
import ${key} from "${value}";
|
|
51
|
-
export { ${key} };`;
|
|
52
|
-
return "";
|
|
53
|
-
}).join("\n"));
|
|
54
|
-
return (0, defu.default)({
|
|
55
|
-
alias: context.alias,
|
|
56
|
-
inject: context.config.inject && Object.keys(context.config.inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js")] : void 0
|
|
57
|
-
}, context.config?.esbuild ? context.config.esbuild : {}, {
|
|
58
|
-
mainFields: context.config.resolve.mainFields,
|
|
59
|
-
conditions: context.config.resolve.conditions,
|
|
60
|
-
define: context.config.define,
|
|
61
|
-
resolveExtensions: context.config.resolve.extensions,
|
|
62
|
-
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
63
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
64
|
-
platform: context.config.platform,
|
|
65
|
-
outdir: context.config.output.buildPath,
|
|
66
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
67
|
-
minify: context.config.mode !== "development",
|
|
68
|
-
metafile: context.config.mode === "development",
|
|
69
|
-
sourcemap: context.config.mode === "development"
|
|
70
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
//#endregion
|
|
74
|
-
exports.resolveOptions = resolveOptions;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import "../../../core/src/lib/entry.mjs";
|
|
2
|
-
import defu from "defu";
|
|
3
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import "@stryke/path/replace";
|
|
5
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
6
|
-
import { camelCase } from "@stryke/string-format/camel-case";
|
|
7
|
-
|
|
8
|
-
//#region ../plugin-esbuild/src/helpers/resolve-options.ts
|
|
9
|
-
const DEFAULT_ESBUILD_CONFIG = {
|
|
10
|
-
target: "esnext",
|
|
11
|
-
platform: "neutral",
|
|
12
|
-
format: "esm",
|
|
13
|
-
write: true,
|
|
14
|
-
minify: true,
|
|
15
|
-
sourcemap: false,
|
|
16
|
-
bundle: true,
|
|
17
|
-
treeShaking: true,
|
|
18
|
-
keepNames: true,
|
|
19
|
-
splitting: true,
|
|
20
|
-
logLevel: "silent"
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Resolves the esbuild options.
|
|
24
|
-
*
|
|
25
|
-
* @param context - The build context.
|
|
26
|
-
* @returns The resolved esbuild options.
|
|
27
|
-
*/
|
|
28
|
-
function resolveOptions(context) {
|
|
29
|
-
if (context.config.inject && Object.keys(context.config.inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js"), Object.entries(context.config.inject).map(([key, value]) => {
|
|
30
|
-
if (value) if (Array.isArray(value)) {
|
|
31
|
-
if (camelCase(key) !== key) {
|
|
32
|
-
if (value.length === 1) return `
|
|
33
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
34
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
35
|
-
else if (value.length > 1) return `
|
|
36
|
-
import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
|
|
37
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
38
|
-
} else if (value.length === 1) return `
|
|
39
|
-
import ${key} from "${value[0]}";
|
|
40
|
-
export { ${key} };`;
|
|
41
|
-
else if (value.length > 1) return `
|
|
42
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
43
|
-
export { ${key} };`;
|
|
44
|
-
} else if (camelCase(key) !== key) return `
|
|
45
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
46
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
47
|
-
else return `
|
|
48
|
-
import ${key} from "${value}";
|
|
49
|
-
export { ${key} };`;
|
|
50
|
-
return "";
|
|
51
|
-
}).join("\n"));
|
|
52
|
-
return defu({
|
|
53
|
-
alias: context.alias,
|
|
54
|
-
inject: context.config.inject && Object.keys(context.config.inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js")] : void 0
|
|
55
|
-
}, context.config?.esbuild ? context.config.esbuild : {}, {
|
|
56
|
-
mainFields: context.config.resolve.mainFields,
|
|
57
|
-
conditions: context.config.resolve.conditions,
|
|
58
|
-
define: context.config.define,
|
|
59
|
-
resolveExtensions: context.config.resolve.extensions,
|
|
60
|
-
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
61
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
62
|
-
platform: context.config.platform,
|
|
63
|
-
outdir: context.config.output.buildPath,
|
|
64
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
65
|
-
minify: context.config.mode !== "development",
|
|
66
|
-
metafile: context.config.mode === "development",
|
|
67
|
-
sourcemap: context.config.mode === "development"
|
|
68
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
export { resolveOptions };
|
|
73
|
-
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.mjs","names":["DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>"],"sources":["../../../../../plugin-esbuild/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 { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport type {\n Context,\n ResolvedEntryTypeDefinition\n} from \"@powerlines/core/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { BuildOptions, Format, LogLevel, Platform } from \"esbuild\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[] = []\n): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n (context as EsbuildPluginContext).config?.esbuild\n ? (context as EsbuildPluginContext).config.esbuild\n : {},\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : (context as EsbuildPluginContext).config?.esbuild\n ? ((context as EsbuildPluginContext).config?.esbuild as BuildOptions)\n .packages\n : undefined,\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;AA+BA,MAAaA,yBAAgD;CAC3D,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,aAAa;CACb,WAAW;CACX,WAAW;CACX,UAAU;CACX;;;;;;;AAkCD,SAAgB,eAAe,SAAgC;AAC7D,KAAI,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,EACvE,SAAQ,GAAG,UACT,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,EACD,OAAO,QAAQ,QAAQ,OAAO,OAAO,CAClC,KAAK,CAAC,KAAK,WAAW;AACrB,MAAI,MACF,KAAI,MAAM,QAAQ,MAAM,EACtB;OAAI,UAAU,IAAI,KAAK,KACrB;QAAI,MAAM,WAAW,EACnB,QAAO;SAChB,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;aACV,MAAM,SAAS,EACxB,QAAO;SAChB,MAAM,OAAO,MAAM,QAAQ,UAAU,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,UAAU,IAAI,CAAC,IAAI,SAAS,MAAM,GAAG;WACrG,UAAU,IAAI,CAAC,OAAO,IAAI;cAEZ,MAAM,WAAW,EAC1B,QAAO;SACd,IAAI,SAAS,MAAM,GAAG;WACpB,IAAI;YACU,MAAM,SAAS,EACxB,QAAO;SACd,MAAM,OAAO,MAAM,QAAQ,QAAQ,KAAK,MAAM,GAAG,MAAM,IAAI,IAAI,SAAS,MAAM,GAAG;WAC/E,IAAI;aAEQ,UAAU,IAAI,KAAK,IAC5B,QAAO;SACZ,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;MAEvB,QAAO;SACZ,IAAI,SAAS,MAAM;WACjB,IAAI;AAIL,SAAO;GACP,CACD,KAAK,KAAK,CACd;AAGH,QAAO,KACL;EACE,OAAO,QAAQ;EACf,QACE,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,IACjE,CACE,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,CACF,GACD;EACP,EACA,QAAiC,QAAQ,UACrC,QAAiC,OAAO,UACzC,EAAE,EACN;EACE,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,QAAQ,QAAQ,OAAO;EACvB,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,UAAU,QAAQ,OAAO,QAAQ,wBAC7B,aACC,QAAiC,QAAQ,WACtC,QAAiC,QAAQ,SACxC,WACH;EACN,QAAS,MAAM,QAAQ,QAAQ,OAAO,OAAO,OAAO,GAChD,QAAQ,OAAO,OAAO,OAAO,KAC7B,QAAQ,OAAO,OAAO;EAC1B,UAAU,QAAQ,OAAO;EACzB,QAAQ,QAAQ,OAAO,OAAO;EAC9B,UAAU,QAAQ,SAAS;EAC3B,QAAQ,QAAQ,OAAO,SAAS;EAChC,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,SAAS;EACpC,EACD,uBACD"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_resolve_options = require('../../../plugin-rollup/src/helpers/resolve-options.cjs');
|
|
3
|
-
let defu = require("defu");
|
|
4
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
5
|
-
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
|
-
let __stryke_path_append = require("@stryke/path/append");
|
|
7
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
8
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
9
|
-
let __rollup_plugin_babel = require("@rollup/plugin-babel");
|
|
10
|
-
let __rollup_plugin_inject = require("@rollup/plugin-inject");
|
|
11
|
-
__rollup_plugin_inject = require_rolldown_runtime.__toESM(__rollup_plugin_inject);
|
|
12
|
-
let __rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
|
|
13
|
-
__rollup_plugin_node_resolve = require_rolldown_runtime.__toESM(__rollup_plugin_node_resolve);
|
|
14
|
-
let __rollup_plugin_replace = require("@rollup/plugin-replace");
|
|
15
|
-
__rollup_plugin_replace = require_rolldown_runtime.__toESM(__rollup_plugin_replace);
|
|
16
|
-
let node_fs = require("node:fs");
|
|
17
|
-
let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
|
|
18
|
-
rollup_plugin_typescript2 = require_rolldown_runtime.__toESM(rollup_plugin_typescript2);
|
|
19
|
-
let rolldown_experimental = require("rolldown/experimental");
|
|
20
|
-
|
|
21
|
-
//#region ../plugin-rolldown/src/helpers/resolve-options.ts
|
|
22
|
-
/**
|
|
23
|
-
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
24
|
-
*
|
|
25
|
-
* @param context - The build context.
|
|
26
|
-
* @returns The resolved options.
|
|
27
|
-
*/
|
|
28
|
-
function resolveOptions(context) {
|
|
29
|
-
return (0, defu.default)({
|
|
30
|
-
input: (0, node_fs.globSync)((0, __stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
|
|
31
|
-
external: (source) => {
|
|
32
|
-
if (context.config.resolve.external && (0, __stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
|
|
33
|
-
if (context.config.resolve.noExternal && (0, __stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
|
|
34
|
-
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
35
|
-
return !context.config.resolve.skipNodeModulesBundle;
|
|
36
|
-
},
|
|
37
|
-
plugins: [
|
|
38
|
-
(0, rollup_plugin_typescript2.default)({
|
|
39
|
-
check: false,
|
|
40
|
-
tsconfig: context.tsconfig.tsconfigFilePath
|
|
41
|
-
}),
|
|
42
|
-
context.config.define && Object.keys(context.config.define).length > 0 && (0, __rollup_plugin_replace.default)({
|
|
43
|
-
sourceMap: context.config.mode === "development",
|
|
44
|
-
preventAssignment: true,
|
|
45
|
-
...context.config.define ?? {}
|
|
46
|
-
}),
|
|
47
|
-
context.config.inject && Object.keys(context.config.inject).length > 0 && (0, __rollup_plugin_inject.default)({
|
|
48
|
-
sourceMap: context.config.mode === "development",
|
|
49
|
-
...context.config.inject
|
|
50
|
-
}),
|
|
51
|
-
(0, rolldown_experimental.viteAliasPlugin)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
52
|
-
if (!ret.find((e) => e.find === id)) ret.push({
|
|
53
|
-
find: id,
|
|
54
|
-
replacement: path
|
|
55
|
-
});
|
|
56
|
-
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
57
|
-
return ret;
|
|
58
|
-
}, []) }),
|
|
59
|
-
context.config.babel && (0, __rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
|
|
60
|
-
caller: {
|
|
61
|
-
name: "powerlines",
|
|
62
|
-
supportsStaticESM: true
|
|
63
|
-
},
|
|
64
|
-
cwd: context.config.root,
|
|
65
|
-
babelrc: false,
|
|
66
|
-
extensions: [
|
|
67
|
-
".js",
|
|
68
|
-
".jsx",
|
|
69
|
-
".ts",
|
|
70
|
-
".tsx"
|
|
71
|
-
],
|
|
72
|
-
babelHelpers: "bundled",
|
|
73
|
-
skipPreflightCheck: true,
|
|
74
|
-
exclude: /node_modules/
|
|
75
|
-
})),
|
|
76
|
-
(0, __rollup_plugin_node_resolve.default)({
|
|
77
|
-
moduleDirectories: ["node_modules"],
|
|
78
|
-
preferBuiltins: true
|
|
79
|
-
}),
|
|
80
|
-
require_resolve_options.dtsBundlePlugin
|
|
81
|
-
]
|
|
82
|
-
}, context.config?.rolldown ? context.config?.rolldown : {}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
83
|
-
resolve: {
|
|
84
|
-
alias: context.alias,
|
|
85
|
-
mainFields: context.config.resolve.mainFields,
|
|
86
|
-
conditions: context.config.resolve.conditions,
|
|
87
|
-
define: context.config.define,
|
|
88
|
-
extensions: context.config.resolve.extensions
|
|
89
|
-
},
|
|
90
|
-
transform: {
|
|
91
|
-
define: context.config.define,
|
|
92
|
-
inject: context.config.inject
|
|
93
|
-
},
|
|
94
|
-
platform: context.config.platform,
|
|
95
|
-
tsconfig: (0, __stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
96
|
-
cache: !context.config.skipCache ? (0, __stryke_path_join_paths.joinPaths)(context.cachePath, "rolldown") : false,
|
|
97
|
-
logLevel: context.config.logLevel,
|
|
98
|
-
onLog(level, log) {
|
|
99
|
-
if (log.message?.trim()) context.log(level === "info" ? "debug" : level, log.message?.trim() ?? "");
|
|
100
|
-
},
|
|
101
|
-
minify: context.config.mode === "production",
|
|
102
|
-
output: [{
|
|
103
|
-
dir: context.config.output.buildPath,
|
|
104
|
-
format: "es",
|
|
105
|
-
preserveModules: true,
|
|
106
|
-
sourcemap: context.config.mode === "development"
|
|
107
|
-
}, {
|
|
108
|
-
dir: context.config.output.buildPath,
|
|
109
|
-
format: "cjs",
|
|
110
|
-
preserveModules: true,
|
|
111
|
-
sourcemap: context.config.mode === "development"
|
|
112
|
-
}]
|
|
113
|
-
}, {
|
|
114
|
-
keepNames: true,
|
|
115
|
-
treeshake: true,
|
|
116
|
-
shimMissingExports: true,
|
|
117
|
-
transform: { target: "esnext" }
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
exports.resolveOptions = resolveOptions;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { dtsBundlePlugin } from "../../../plugin-rollup/src/helpers/resolve-options.mjs";
|
|
2
|
-
import defu from "defu";
|
|
3
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
4
|
-
import { appendPath } from "@stryke/path/append";
|
|
5
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
6
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
7
|
-
import { getBabelInputPlugin } from "@rollup/plugin-babel";
|
|
8
|
-
import inject from "@rollup/plugin-inject";
|
|
9
|
-
import resolve from "@rollup/plugin-node-resolve";
|
|
10
|
-
import replace from "@rollup/plugin-replace";
|
|
11
|
-
import { globSync } from "node:fs";
|
|
12
|
-
import typescriptPlugin from "rollup-plugin-typescript2";
|
|
13
|
-
import { viteAliasPlugin } from "rolldown/experimental";
|
|
14
|
-
|
|
15
|
-
//#region ../plugin-rolldown/src/helpers/resolve-options.ts
|
|
16
|
-
/**
|
|
17
|
-
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
18
|
-
*
|
|
19
|
-
* @param context - The build context.
|
|
20
|
-
* @returns The resolved options.
|
|
21
|
-
*/
|
|
22
|
-
function resolveOptions(context) {
|
|
23
|
-
return defu({
|
|
24
|
-
input: globSync(toArray(context.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
|
|
25
|
-
external: (source) => {
|
|
26
|
-
if (context.config.resolve.external && toArray(context.config.resolve.external).includes(source)) return true;
|
|
27
|
-
if (context.config.resolve.noExternal && toArray(context.config.resolve.noExternal).includes(source)) return false;
|
|
28
|
-
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
29
|
-
return !context.config.resolve.skipNodeModulesBundle;
|
|
30
|
-
},
|
|
31
|
-
plugins: [
|
|
32
|
-
typescriptPlugin({
|
|
33
|
-
check: false,
|
|
34
|
-
tsconfig: context.tsconfig.tsconfigFilePath
|
|
35
|
-
}),
|
|
36
|
-
context.config.define && Object.keys(context.config.define).length > 0 && replace({
|
|
37
|
-
sourceMap: context.config.mode === "development",
|
|
38
|
-
preventAssignment: true,
|
|
39
|
-
...context.config.define ?? {}
|
|
40
|
-
}),
|
|
41
|
-
context.config.inject && Object.keys(context.config.inject).length > 0 && inject({
|
|
42
|
-
sourceMap: context.config.mode === "development",
|
|
43
|
-
...context.config.inject
|
|
44
|
-
}),
|
|
45
|
-
viteAliasPlugin({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
46
|
-
if (!ret.find((e) => e.find === id)) ret.push({
|
|
47
|
-
find: id,
|
|
48
|
-
replacement: path
|
|
49
|
-
});
|
|
50
|
-
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
51
|
-
return ret;
|
|
52
|
-
}, []) }),
|
|
53
|
-
context.config.babel && getBabelInputPlugin(defu(context.config.babel, {
|
|
54
|
-
caller: {
|
|
55
|
-
name: "powerlines",
|
|
56
|
-
supportsStaticESM: true
|
|
57
|
-
},
|
|
58
|
-
cwd: context.config.root,
|
|
59
|
-
babelrc: false,
|
|
60
|
-
extensions: [
|
|
61
|
-
".js",
|
|
62
|
-
".jsx",
|
|
63
|
-
".ts",
|
|
64
|
-
".tsx"
|
|
65
|
-
],
|
|
66
|
-
babelHelpers: "bundled",
|
|
67
|
-
skipPreflightCheck: true,
|
|
68
|
-
exclude: /node_modules/
|
|
69
|
-
})),
|
|
70
|
-
resolve({
|
|
71
|
-
moduleDirectories: ["node_modules"],
|
|
72
|
-
preferBuiltins: true
|
|
73
|
-
}),
|
|
74
|
-
dtsBundlePlugin
|
|
75
|
-
]
|
|
76
|
-
}, context.config?.rolldown ? context.config?.rolldown : {}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
77
|
-
resolve: {
|
|
78
|
-
alias: context.alias,
|
|
79
|
-
mainFields: context.config.resolve.mainFields,
|
|
80
|
-
conditions: context.config.resolve.conditions,
|
|
81
|
-
define: context.config.define,
|
|
82
|
-
extensions: context.config.resolve.extensions
|
|
83
|
-
},
|
|
84
|
-
transform: {
|
|
85
|
-
define: context.config.define,
|
|
86
|
-
inject: context.config.inject
|
|
87
|
-
},
|
|
88
|
-
platform: context.config.platform,
|
|
89
|
-
tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
90
|
-
cache: !context.config.skipCache ? joinPaths(context.cachePath, "rolldown") : false,
|
|
91
|
-
logLevel: context.config.logLevel,
|
|
92
|
-
onLog(level, log) {
|
|
93
|
-
if (log.message?.trim()) context.log(level === "info" ? "debug" : level, log.message?.trim() ?? "");
|
|
94
|
-
},
|
|
95
|
-
minify: context.config.mode === "production",
|
|
96
|
-
output: [{
|
|
97
|
-
dir: context.config.output.buildPath,
|
|
98
|
-
format: "es",
|
|
99
|
-
preserveModules: true,
|
|
100
|
-
sourcemap: context.config.mode === "development"
|
|
101
|
-
}, {
|
|
102
|
-
dir: context.config.output.buildPath,
|
|
103
|
-
format: "cjs",
|
|
104
|
-
preserveModules: true,
|
|
105
|
-
sourcemap: context.config.mode === "development"
|
|
106
|
-
}]
|
|
107
|
-
}, {
|
|
108
|
-
keepNames: true,
|
|
109
|
-
treeshake: true,
|
|
110
|
-
shimMissingExports: true,
|
|
111
|
-
transform: { target: "esnext" }
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
export { resolveOptions };
|
|
117
|
-
//# sourceMappingURL=resolve-options.mjs.map
|