@powerlines/plugin-esbuild 0.13.357 → 0.13.361
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.
|
@@ -77,7 +77,7 @@ export { ${key} };`;
|
|
|
77
77
|
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
78
78
|
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
79
79
|
platform: context.config.platform,
|
|
80
|
-
outdir: context.config.output.
|
|
80
|
+
outdir: context.config.output.path,
|
|
81
81
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
82
82
|
minify: context.config.mode !== "development",
|
|
83
83
|
metafile: context.config.mode === "development",
|
|
@@ -74,7 +74,7 @@ export { ${key} };`;
|
|
|
74
74
|
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
75
75
|
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
76
76
|
platform: context.config.platform,
|
|
77
|
-
outdir: context.config.output.
|
|
77
|
+
outdir: context.config.output.path,
|
|
78
78
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
79
79
|
minify: context.config.mode !== "development",
|
|
80
80
|
metafile: context.config.mode === "development",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.mjs","names":[],"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 type { Context, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\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.
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":[],"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 type { Context, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\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.path,\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":";;;;;;;;AA4BA,MAAa,yBAAgD;CAC3D,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,aAAa;CACb,WAAW;CACX,WAAW;CACX,UAAU;CACX;;;;;;;;AASD,SAAgB,aACd,SACA,cAAwD,EAAE,EAC7B;AAC7B,QAAO,YAAY,QAChB,KAAK,UAAU;AACd,MAAI,SAAS,MAAM,CACjB,KAAI,iBAAiB,YAAY,OAAO,QAAQ,OAAO,KAAK,CAAC,IAC3D,YAAY,OAAO,QAAQ,OAAO,KAAK;MAEzC,KAAI,MAAM,UAAU,mBAAmB,SAAS,MAAM,IAAI,MAAM;AAGlE,SAAO;IAET,EAAE,CACH;;;;;;;;AASH,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,EAC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
"name": "@powerlines/plugin-esbuild",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.361",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to build projects using esbuild.",
|
|
6
6
|
"keywords": ["esbuild", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -83,16 +83,16 @@
|
|
|
83
83
|
"peerDependencies": { "esbuild": ">=0.27.3" },
|
|
84
84
|
"peerDependenciesMeta": { "esbuild": { "optional": false } },
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@powerlines/core": "^0.
|
|
87
|
-
"@stryke/fs": "^0.33.
|
|
88
|
-
"@stryke/path": "^0.27.
|
|
89
|
-
"@stryke/type-checks": "^0.5.
|
|
90
|
-
"@stryke/types": "^0.
|
|
86
|
+
"@powerlines/core": "^0.5.2",
|
|
87
|
+
"@stryke/fs": "^0.33.63",
|
|
88
|
+
"@stryke/path": "^0.27.2",
|
|
89
|
+
"@stryke/type-checks": "^0.5.41",
|
|
90
|
+
"@stryke/types": "^0.11.1",
|
|
91
91
|
"defu": "^6.1.4",
|
|
92
92
|
"jiti": "^2.6.1",
|
|
93
93
|
"unplugin": "^3.0.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": { "esbuild": "^0.27.4", "@types/node": "^25.5.0" },
|
|
96
96
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "c6ab4089999ed8b1f08214f9358d527de33dfa5e"
|
|
98
98
|
}
|