@powerlines/plugin-rollup 0.7.442 → 0.7.443
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/resolve-options.cjs +3 -3
- package/dist/helpers/resolve-options.mjs +3 -3
- package/dist/helpers/resolve-options.mjs.map +1 -1
- package/dist/index.cjs +8 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
|
@@ -102,19 +102,19 @@ function resolveOptions(context) {
|
|
|
102
102
|
].filter(Boolean)
|
|
103
103
|
}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
104
104
|
cache: !context.config.skipCache ? (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
|
|
105
|
-
logLevel: context.config.logLevel,
|
|
105
|
+
logLevel: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
|
|
106
106
|
output: [{
|
|
107
107
|
dir: context.config.output.path,
|
|
108
108
|
format: "es",
|
|
109
109
|
entryFileNames: "[name].js",
|
|
110
110
|
preserveModules: true,
|
|
111
|
-
sourcemap: context.config.
|
|
111
|
+
sourcemap: context.config.output.sourceMap
|
|
112
112
|
}, {
|
|
113
113
|
dir: context.config.output.path,
|
|
114
114
|
format: "cjs",
|
|
115
115
|
entryFileNames: "[name].cjs",
|
|
116
116
|
preserveModules: true,
|
|
117
|
-
sourcemap: context.config.
|
|
117
|
+
sourcemap: context.config.output.sourceMap
|
|
118
118
|
}]
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -94,19 +94,19 @@ function resolveOptions(context) {
|
|
|
94
94
|
].filter(Boolean)
|
|
95
95
|
}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
96
96
|
cache: !context.config.skipCache ? joinPaths(context.cachePath, "rollup") : false,
|
|
97
|
-
logLevel: context.config.logLevel,
|
|
97
|
+
logLevel: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
|
|
98
98
|
output: [{
|
|
99
99
|
dir: context.config.output.path,
|
|
100
100
|
format: "es",
|
|
101
101
|
entryFileNames: "[name].js",
|
|
102
102
|
preserveModules: true,
|
|
103
|
-
sourcemap: context.config.
|
|
103
|
+
sourcemap: context.config.output.sourceMap
|
|
104
104
|
}, {
|
|
105
105
|
dir: context.config.output.path,
|
|
106
106
|
format: "cjs",
|
|
107
107
|
entryFileNames: "[name].cjs",
|
|
108
108
|
preserveModules: true,
|
|
109
|
-
sourcemap: context.config.
|
|
109
|
+
sourcemap: context.config.output.sourceMap
|
|
110
110
|
}]
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -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 } from \"@powerlines/core\";\nimport type { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport alias from \"@rollup/plugin-alias\";\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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RollupPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RollupOptions {\n const result = defu(\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 ].filter(Boolean) as Plugin[]\n },\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n logLevel: context.config.logLevel,\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.
|
|
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 } from \"@powerlines/core\";\nimport type { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport alias from \"@rollup/plugin-alias\";\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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RollupPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RollupOptions {\n const result = defu(\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 ].filter(Boolean) as Plugin[]\n },\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n logLevel:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"error\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n }\n ]\n }\n ) as RollupOptions;\n\n return result;\n}\n"],"mappings":"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"}
|
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const require_helpers_resolve_options = require('./helpers/resolve-options.cjs')
|
|
|
4
4
|
const require_helpers_unplugin = require('./helpers/unplugin.cjs');
|
|
5
5
|
require('./helpers/index.cjs');
|
|
6
6
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
7
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
7
8
|
let defu = require("defu");
|
|
8
9
|
defu = require_runtime.__toESM(defu, 1);
|
|
9
10
|
let rollup = require("rollup");
|
|
@@ -22,7 +23,13 @@ const plugin = (options = {}) => {
|
|
|
22
23
|
};
|
|
23
24
|
},
|
|
24
25
|
async build() {
|
|
25
|
-
|
|
26
|
+
this.debug("Starting Rollup build process...");
|
|
27
|
+
const options = (0, defu.default)({ plugins: [require_helpers_unplugin.createRollupPlugin(this)] }, require_helpers_resolve_options.resolveOptions(this));
|
|
28
|
+
this.trace({
|
|
29
|
+
meta: { category: "config" },
|
|
30
|
+
message: `Resolved Rollup configuration: \n${JSON.stringify((0, _stryke_helpers_omit.omit)(options, ["plugins"]), null, 2)}`
|
|
31
|
+
});
|
|
32
|
+
const result = await (0, rollup.rollup)(options);
|
|
26
33
|
await Promise.all((0, _stryke_convert_to_array.toArray)(this.config.output.format).map(async (format) => result.write({ format })));
|
|
27
34
|
}
|
|
28
35
|
};
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YA+BY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;AAJW;;;AAAA,cAWX,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YA+BY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;AAJW;;;AAAA,cAWX,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { dtsBundlePlugin, resolveOptions } from "./helpers/resolve-options.mjs";
|
|
|
2
2
|
import { createRollupPlugin } from "./helpers/unplugin.mjs";
|
|
3
3
|
import "./helpers/index.mjs";
|
|
4
4
|
import { toArray } from "@stryke/convert/to-array";
|
|
5
|
+
import { omit } from "@stryke/helpers/omit";
|
|
5
6
|
import defu from "defu";
|
|
6
7
|
import { rollup } from "rollup";
|
|
7
8
|
|
|
@@ -19,7 +20,13 @@ const plugin = (options = {}) => {
|
|
|
19
20
|
};
|
|
20
21
|
},
|
|
21
22
|
async build() {
|
|
22
|
-
|
|
23
|
+
this.debug("Starting Rollup build process...");
|
|
24
|
+
const options = defu({ plugins: [createRollupPlugin(this)] }, resolveOptions(this));
|
|
25
|
+
this.trace({
|
|
26
|
+
meta: { category: "config" },
|
|
27
|
+
message: `Resolved Rollup configuration: \n${JSON.stringify(omit(options, ["plugins"]), null, 2)}`
|
|
28
|
+
});
|
|
29
|
+
const result = await rollup(options);
|
|
23
30
|
await Promise.all(toArray(this.config.output.format).map(async (format) => result.write({ format })));
|
|
24
31
|
}
|
|
25
32
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["build"],"sources":["../src/index.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 { Plugin } from \"@powerlines/core\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport { RollupPluginContext, RollupPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n };\n },\n async build() {\n const
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["build"],"sources":["../src/index.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 { Plugin } from \"@powerlines/core\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport { RollupPluginContext, RollupPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n };\n },\n async build() {\n this.debug(\"Starting Rollup build process...\");\n\n const options = defu(\n {\n plugins: [createRollupPlugin(this)]\n },\n resolveOptions(this)\n );\n\n this.trace({\n meta: {\n category: \"config\"\n },\n message: `Resolved Rollup configuration: \\n${JSON.stringify(\n omit(options, [\"plugins\"]),\n null,\n 2\n )}`\n });\n\n const result = await build(options);\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAuCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;GAE9C,MAAM,UAAU,KACd,EACE,SAAS,CAAC,mBAAmB,KAAK,CAAC,EACpC,EACD,eAAe,KAAK,CACrB;AAED,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,oCAAoC,KAAK,UAChD,KAAK,SAAS,CAAC,UAAU,CAAC,EAC1B,MACA,EACD;IACF,CAAC;GAEF,MAAM,SAAS,MAAMA,OAAM,QAAQ;AAEnC,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rollup",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.443",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["rollup", "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.44.
|
|
77
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
76
|
+
"@powerlines/core": "^0.44.12",
|
|
77
|
+
"@powerlines/plugin-babel": "^0.12.441",
|
|
78
78
|
"@rollup/plugin-alias": "^6.0.0",
|
|
79
79
|
"@rollup/plugin-babel": "^6.1.0",
|
|
80
80
|
"@rollup/plugin-inject": "^5.0.5",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"@rollup/plugin-replace": "^6.0.3",
|
|
83
83
|
"@stryke/convert": "^0.7.2",
|
|
84
84
|
"@stryke/fs": "^0.33.69",
|
|
85
|
+
"@stryke/helpers": "^0.10.11",
|
|
85
86
|
"@stryke/path": "^0.28.1",
|
|
86
87
|
"@stryke/type-checks": "^0.6.4",
|
|
87
88
|
"@stryke/types": "^0.11.6",
|
|
@@ -94,5 +95,5 @@
|
|
|
94
95
|
"peerDependencies": { "rollup": ">=4.46.4" },
|
|
95
96
|
"peerDependenciesMeta": { "rollup": { "optional": false } },
|
|
96
97
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "93fe3bf5054baa0bb1841c64fe082da56631a010"
|
|
98
99
|
}
|