@powerlines/plugin-rolldown 0.7.359 → 0.7.363
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.
|
@@ -105,12 +105,12 @@ function resolveOptions(context) {
|
|
|
105
105
|
},
|
|
106
106
|
minify: context.config.mode === "production",
|
|
107
107
|
output: [{
|
|
108
|
-
dir: context.config.output.
|
|
108
|
+
dir: context.config.output.path,
|
|
109
109
|
format: "es",
|
|
110
110
|
preserveModules: true,
|
|
111
111
|
sourcemap: context.config.mode === "development"
|
|
112
112
|
}, {
|
|
113
|
-
dir: context.config.output.
|
|
113
|
+
dir: context.config.output.path,
|
|
114
114
|
format: "cjs",
|
|
115
115
|
preserveModules: true,
|
|
116
116
|
sourcemap: context.config.mode === "development"
|
|
@@ -98,12 +98,12 @@ function resolveOptions(context) {
|
|
|
98
98
|
},
|
|
99
99
|
minify: context.config.mode === "production",
|
|
100
100
|
output: [{
|
|
101
|
-
dir: context.config.output.
|
|
101
|
+
dir: context.config.output.path,
|
|
102
102
|
format: "es",
|
|
103
103
|
preserveModules: true,
|
|
104
104
|
sourcemap: context.config.mode === "development"
|
|
105
105
|
}, {
|
|
106
|
-
dir: context.config.output.
|
|
106
|
+
dir: context.config.output.path,
|
|
107
107
|
format: "cjs",
|
|
108
108
|
preserveModules: true,
|
|
109
109
|
sourcemap: context.config.mode === "development"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.mjs","names":["alias"],"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 { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport { dtsBundlePlugin } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { RollupPluginResolvedConfig } from \"@powerlines/plugin-rollup/types/plugin\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport { RolldownOptions, RollupLog } from \"rolldown\";\nimport { viteAliasPlugin as alias } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RolldownPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RolldownOptions {\n return defu<RolldownOptions, any>(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: 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 }),\n (context.config as BabelPluginResolvedConfig).babel &&\n getBabelInputPlugin(\n defu((context.config as BabelPluginResolvedConfig).babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.root,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ]\n },\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? (context.config as RolldownPluginResolvedConfig)?.rolldown\n : {},\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n resolve: {\n alias: context.alias,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n extensions: context.config.resolve.extensions\n },\n transform: {\n define: context.config.define,\n inject: context.config.inject,\n typescript: {\n onlyRemoveTypeImports: context.tsconfig.options.verbatimModuleSyntax,\n target: context.tsconfig.options.target\n }\n },\n platform: context.config.platform,\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n logLevel: context.config.logLevel,\n onLog(level: \"info\" | \"debug\" | \"warn\", log: RollupLog) {\n if (log.message?.trim()) {\n context.log(\n level === \"info\" ? \"debug\" : level,\n log.message?.trim() ?? \"\"\n );\n }\n },\n minify: context.config.mode === \"production\",\n output: [\n {\n dir: context.config.output.
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":["alias"],"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 { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport { dtsBundlePlugin } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { RollupPluginResolvedConfig } from \"@powerlines/plugin-rollup/types/plugin\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport { RolldownOptions, RollupLog } from \"rolldown\";\nimport { viteAliasPlugin as alias } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RolldownPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RolldownOptions {\n return defu<RolldownOptions, any>(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: 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 }),\n (context.config as BabelPluginResolvedConfig).babel &&\n getBabelInputPlugin(\n defu((context.config as BabelPluginResolvedConfig).babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.root,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ]\n },\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? (context.config as RolldownPluginResolvedConfig)?.rolldown\n : {},\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n resolve: {\n alias: context.alias,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n extensions: context.config.resolve.extensions\n },\n transform: {\n define: context.config.define,\n inject: context.config.inject,\n typescript: {\n onlyRemoveTypeImports: context.tsconfig.options.verbatimModuleSyntax,\n target: context.tsconfig.options.target\n }\n },\n platform: context.config.platform,\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n logLevel: context.config.logLevel,\n onLog(level: \"info\" | \"debug\" | \"warn\", log: RollupLog) {\n if (log.message?.trim()) {\n context.log(\n level === \"info\" ? \"debug\" : level,\n log.message?.trim() ?? \"\"\n );\n }\n },\n minify: context.config.mode === \"production\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n }\n ]\n },\n {\n keepNames: true,\n treeshake: true,\n shimMissingExports: true,\n transform: {\n target: \"esnext\"\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,eAAe,SAAmC;AAChE,QAAO,KACL;EACE,OAAO,SACL,QAAQ,QAAQ,MAAM,CAAC,KAAI,UACzB,SAAS,MAAM,GAAG,QAAQ,MAAM,KACjC,CACF,CAAC,MAAM;EACR,WAAW,WAAmB;AAC5B,OACE,QAAQ,OAAO,QAAQ,YACvB,QAAQ,QAAQ,OAAO,QAAQ,SAAS,CAAC,SAAS,OAAO,CAEzD,QAAO;AAGT,OACE,QAAQ,OAAO,QAAQ,cACvB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,CAAC,SAAS,OAAO,CAE3D,QAAO;AAGT,OAAI,QAAQ,SAAS,SAAS,OAAO,CACnC,QAAO,QAAQ,OAAO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Q;GACnC,QAAQ,QAAQ,OAAO;GACvB,YAAY,QAAQ,OAAO,QAAQ;GACpC;EACD,WAAW;GACT,QAAQ,QAAQ,OAAO;GACvB,QAAQ,QAAQ,OAAO;GACvB,YAAY;IACV,uBAAuB,QAAQ,SAAS,QAAQ;IAChD,QAAQ,QAAQ,SAAS,QAAQ;IAClC;GACF;EACD,UAAU,QAAQ,OAAO;EACzB,UAAU,WACR,QAAQ,SAAS,kBACjB,QAAQ,gBAAgB,cACzB;EACD,OAAO,CAAC,QAAQ,OAAO,YACnB,UAAU,QAAQ,WAAW,WAAW,GACxC;EACJ,UAAU,QAAQ,OAAO;EACzB,MAAM,OAAkC,KAAgB;AACtD,OAAI,IAAI,SAAS,MAAM,CACrB,SAAQ,IACN,UAAU,SAAS,UAAU,OAC7B,IAAI,SAAS,MAAM,IAAI,GACxB;;EAGL,QAAQ,QAAQ,OAAO,SAAS;EAChC,QAAQ,CACN;GACE,KAAK,QAAQ,OAAO,OAAO;GAC3B,QAAQ;GACR,iBAAiB;GACjB,WAAW,QAAQ,OAAO,SAAS;GACpC,EACD;GACE,KAAK,QAAQ,OAAO,OAAO;GAC3B,QAAQ;GACR,iBAAiB;GACjB,WAAW,QAAQ,OAAO,SAAS;GACpC,CACF;EACF,EACD;EACE,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,WAAW,EACT,QAAQ,UACT;EACF,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rolldown",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.363",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["rolldown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"peerDependencies": { "rolldown": ">=1.0.0-rc.9 <2.0.0" },
|
|
44
44
|
"peerDependenciesMeta": { "rolldown": { "optional": false } },
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@powerlines/core": "^0.
|
|
47
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
48
|
-
"@powerlines/plugin-rollup": "^0.7.
|
|
49
|
-
"@stryke/convert": "^0.6.
|
|
50
|
-
"@stryke/fs": "^0.33.
|
|
51
|
-
"@stryke/path": "^0.27.
|
|
52
|
-
"@stryke/type-checks": "^0.5.
|
|
53
|
-
"@stryke/types": "^0.
|
|
46
|
+
"@powerlines/core": "^0.5.2",
|
|
47
|
+
"@powerlines/plugin-babel": "^0.12.360",
|
|
48
|
+
"@powerlines/plugin-rollup": "^0.7.361",
|
|
49
|
+
"@stryke/convert": "^0.6.56",
|
|
50
|
+
"@stryke/fs": "^0.33.63",
|
|
51
|
+
"@stryke/path": "^0.27.2",
|
|
52
|
+
"@stryke/type-checks": "^0.5.41",
|
|
53
|
+
"@stryke/types": "^0.11.1",
|
|
54
54
|
"defu": "^6.1.4",
|
|
55
55
|
"jiti": "^2.6.1",
|
|
56
56
|
"unplugin": "^3.0.0"
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
},
|
|
89
89
|
"./package.json": "./package.json"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c6ab4089999ed8b1f08214f9358d527de33dfa5e"
|
|
92
92
|
}
|