@powerlines/plugin-rspack 0.5.441 → 0.5.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.
@@ -30,8 +30,8 @@ function resolveOptions(context) {
30
30
  context: (0, _stryke_path_join_paths.joinPaths)(context.config.cwd, context.config.root),
31
31
  noExternal: context.builtins,
32
32
  cache: context.config.mode === "development",
33
- devtool: context.config.mode !== "development" ? false : "source-map",
34
- optimization: { minimize: context.config.output.minify ?? context.config.mode !== "development" }
33
+ devtool: context.config.output.sourceMap ? "source-map" : false,
34
+ optimization: { minimize: context.config.output.minify }
35
35
  });
36
36
  }
37
37
 
@@ -27,8 +27,8 @@ function resolveOptions(context) {
27
27
  context: joinPaths(context.config.cwd, context.config.root),
28
28
  noExternal: context.builtins,
29
29
  cache: context.config.mode === "development",
30
- devtool: context.config.mode !== "development" ? false : "source-map",
31
- optimization: { minimize: context.config.output.minify ?? context.config.mode !== "development" }
30
+ devtool: context.config.output.sourceMap ? "source-map" : false,
31
+ optimization: { minimize: context.config.output.minify }
32
32
  });
33
33
  }
34
34
 
@@ -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 { Context } from \"@powerlines/core\";\nimport type { Configuration as ExternalRspackOptions } from \"@rspack/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { RspackPluginResolvedConfig } from \"../types\";\n\n/**\n * Resolves the options for [rspack](https://rspack.rs/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ExternalRspackOptions {\n return defu(\n {\n resolve: {\n alias: context.alias\n }\n },\n (context.config as RspackPluginResolvedConfig).rspack\n ? (context.config as RspackPluginResolvedConfig).rspack\n : {},\n {\n external: context.config.resolve.external,\n noExternal: context.config.resolve.noExternal,\n skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle\n },\n {\n output: {\n path: context.config.output.path\n },\n name: context.config.name,\n node:\n context.config.platform === \"node\"\n ? {\n __dirname: true,\n __filename: true,\n global: true\n }\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n recordsInputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n context: joinPaths(context.config.cwd, context.config.root),\n noExternal: context.builtins,\n cache: context.config.mode === \"development\",\n devtool: context.config.mode !== \"development\" ? false : \"source-map\",\n optimization: {\n minimize:\n context.config.output.minify ?? context.config.mode !== \"development\"\n }\n }\n ) as ExternalRspackOptions;\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,eAAe,SAAyC;AACtE,QAAO,KACL,EACE,SAAS,EACP,OAAO,QAAQ,OAChB,EACF,EACA,QAAQ,OAAsC,SAC1C,QAAQ,OAAsC,SAC/C,EAAE,EACN;EACE,UAAU,QAAQ,OAAO,QAAQ;EACjC,YAAY,QAAQ,OAAO,QAAQ;EACnC,uBAAuB,QAAQ,OAAO,QAAQ;EAC/C,EACD;EACE,QAAQ,EACN,MAAM,QAAQ,OAAO,OAAO,MAC7B;EACD,MAAM,QAAQ,OAAO;EACrB,MACE,QAAQ,OAAO,aAAa,SACxB;GACE,WAAW;GACX,YAAY;GACZ,QAAQ;GACT,GACD;EACN,MACE,QAAQ,OAAO,SAAS,gBACnB,gBACA;EACP,kBAAkB,UAChB,QAAQ,WACR,UACA,uBACD;EACD,mBAAmB,UACjB,QAAQ,WACR,UACA,uBACD;EACD,SAAS,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,KAAK;EAC3D,YAAY,QAAQ;EACpB,OAAO,QAAQ,OAAO,SAAS;EAC/B,SAAS,QAAQ,OAAO,SAAS,gBAAgB,QAAQ;EACzD,cAAc,EACZ,UACE,QAAQ,OAAO,OAAO,UAAU,QAAQ,OAAO,SAAS,eAC3D;EACF,CACF"}
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 { Context } from \"@powerlines/core\";\nimport type { Configuration as ExternalRspackOptions } from \"@rspack/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { RspackPluginResolvedConfig } from \"../types\";\n\n/**\n * Resolves the options for [rspack](https://rspack.rs/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ExternalRspackOptions {\n return defu(\n {\n resolve: {\n alias: context.alias\n }\n },\n (context.config as RspackPluginResolvedConfig).rspack\n ? (context.config as RspackPluginResolvedConfig).rspack\n : {},\n {\n external: context.config.resolve.external,\n noExternal: context.config.resolve.noExternal,\n skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle\n },\n {\n output: {\n path: context.config.output.path\n },\n name: context.config.name,\n node:\n context.config.platform === \"node\"\n ? {\n __dirname: true,\n __filename: true,\n global: true\n }\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n recordsInputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"rspack\",\n \".rspack-records.json\"\n ),\n context: joinPaths(context.config.cwd, context.config.root),\n noExternal: context.builtins,\n cache: context.config.mode === \"development\",\n devtool: context.config.output.sourceMap ? \"source-map\" : false,\n optimization: {\n minimize: context.config.output.minify\n }\n }\n ) as ExternalRspackOptions;\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,eAAe,SAAyC;AACtE,QAAO,KACL,EACE,SAAS,EACP,OAAO,QAAQ,OAChB,EACF,EACA,QAAQ,OAAsC,SAC1C,QAAQ,OAAsC,SAC/C,EAAE,EACN;EACE,UAAU,QAAQ,OAAO,QAAQ;EACjC,YAAY,QAAQ,OAAO,QAAQ;EACnC,uBAAuB,QAAQ,OAAO,QAAQ;EAC/C,EACD;EACE,QAAQ,EACN,MAAM,QAAQ,OAAO,OAAO,MAC7B;EACD,MAAM,QAAQ,OAAO;EACrB,MACE,QAAQ,OAAO,aAAa,SACxB;GACE,WAAW;GACX,YAAY;GACZ,QAAQ;GACT,GACD;EACN,MACE,QAAQ,OAAO,SAAS,gBACnB,gBACA;EACP,kBAAkB,UAChB,QAAQ,WACR,UACA,uBACD;EACD,mBAAmB,UACjB,QAAQ,WACR,UACA,uBACD;EACD,SAAS,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,KAAK;EAC3D,YAAY,QAAQ;EACpB,OAAO,QAAQ,OAAO,SAAS;EAC/B,SAAS,QAAQ,OAAO,OAAO,YAAY,eAAe;EAC1D,cAAc,EACZ,UAAU,QAAQ,OAAO,OAAO,QACjC;EACF,CACF"}
@@ -8,7 +8,10 @@ function createRspackPlugin(context) {
8
8
  return (0, unplugin.createRspackPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context, {
9
9
  silenceHookLogging: true,
10
10
  name: "rspack"
11
- }))({});
11
+ }))({
12
+ ...context.options,
13
+ ...context.initialConfig
14
+ });
12
15
  }
13
16
 
14
17
  //#endregion
@@ -6,7 +6,10 @@ function createRspackPlugin(context) {
6
6
  return createRspackPlugin$1(createUnplugin(context, {
7
7
  silenceHookLogging: true,
8
8
  name: "rspack"
9
- }))({});
9
+ }))({
10
+ ...context.options,
11
+ ...context.initialConfig
12
+ });
10
13
  }
11
14
 
12
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"unplugin.mjs","names":["createRspackUnplugin"],"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 { createRspackPlugin as createRspackUnplugin } from \"unplugin\";\nimport { RspackPluginContext } from \"../types/plugin\";\n\nexport function createRspackPlugin(context: RspackPluginContext) {\n return createRspackUnplugin(\n createUnplugin(context, { silenceHookLogging: true, name: \"rspack\" })\n )({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAOA,qBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAU,CAAC,CACtE,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"unplugin.mjs","names":["createRspackUnplugin"],"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 { createRspackPlugin as createRspackUnplugin } from \"unplugin\";\nimport { RspackPluginContext } from \"../types/plugin\";\n\nexport function createRspackPlugin(context: RspackPluginContext) {\n return createRspackUnplugin(\n createUnplugin(context, { silenceHookLogging: true, name: \"rspack\" })\n )({ ...context.options, ...context.initialConfig });\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAOA,qBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAU,CAAC,CACtE,CAAC;EAAE,GAAG,QAAQ;EAAS,GAAG,QAAQ;EAAe,CAAC"}
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 _rspack_core = require("@rspack/core");
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
 
@@ -22,10 +23,16 @@ const plugin = (options = {}) => {
22
23
  } };
23
24
  },
24
25
  async build() {
25
- (0, _rspack_core.rspack)((0, defu.default)({ entry: this.entry.reduce((ret, entry) => {
26
+ this.debug("Starting Rspack build process...");
27
+ const options = (0, defu.default)({ entry: this.entry.reduce((ret, entry) => {
26
28
  ret[entry.output || entry.name || entry.file] = entry.file;
27
29
  return ret;
28
- }, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createRspackPlugin(this)] }));
30
+ }, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createRspackPlugin(this)] });
31
+ this.trace({
32
+ meta: { category: "config" },
33
+ message: `Resolved Rspack configuration: \n${JSON.stringify((0, _stryke_helpers_omit.omit)(options, ["plugins"]), null, 2)}`
34
+ });
35
+ (0, _rspack_core.rspack)(options);
29
36
  }
30
37
  };
31
38
  };
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { resolveOptions } from "./helpers/resolve-options.cjs";
2
2
  import { RspackOptions, __ΩRspackOptions } from "./types/build.cjs";
3
- import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.cjs";
3
+ import { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.cjs";
4
4
  import { createRspackPlugin } from "./helpers/unplugin.cjs";
5
5
  import { Plugin } from "@powerlines/core";
6
6
 
@@ -10,5 +10,5 @@ import { Plugin } from "@powerlines/core";
10
10
  */
11
11
  declare const plugin: <TContext extends RspackPluginContext = RspackPluginContext>(options?: RspackPluginOptions) => Plugin<TContext>;
12
12
  //#endregion
13
- export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
13
+ export { RspackOptions, RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
14
14
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cA+Ba,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cAgCa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { resolveOptions } from "./helpers/resolve-options.mjs";
2
2
  import { RspackOptions, __ΩRspackOptions } from "./types/build.mjs";
3
- import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.mjs";
3
+ import { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.mjs";
4
4
  import { createRspackPlugin } from "./helpers/unplugin.mjs";
5
5
  import { Plugin } from "@powerlines/core";
6
6
 
@@ -10,5 +10,5 @@ import { Plugin } from "@powerlines/core";
10
10
  */
11
11
  declare const plugin: <TContext extends RspackPluginContext = RspackPluginContext>(options?: RspackPluginOptions) => Plugin<TContext>;
12
12
  //#endregion
13
- export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
13
+ export { RspackOptions, RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
14
14
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cA+Ba,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cAgCa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { resolveOptions } from "./helpers/resolve-options.mjs";
2
2
  import { createRspackPlugin } from "./helpers/unplugin.mjs";
3
3
  import "./helpers/index.mjs";
4
4
  import { rspack } from "@rspack/core";
5
+ import { omit } from "@stryke/helpers/omit";
5
6
  import defu from "defu";
6
7
 
7
8
  //#region src/index.ts
@@ -19,10 +20,16 @@ const plugin = (options = {}) => {
19
20
  } };
20
21
  },
21
22
  async build() {
22
- rspack(defu({ entry: this.entry.reduce((ret, entry) => {
23
+ this.debug("Starting Rspack build process...");
24
+ const options = defu({ entry: this.entry.reduce((ret, entry) => {
23
25
  ret[entry.output || entry.name || entry.file] = entry.file;
24
26
  return ret;
25
- }, {}) }, resolveOptions(this), { plugins: [createRspackPlugin(this)] }));
27
+ }, {}) }, resolveOptions(this), { plugins: [createRspackPlugin(this)] });
28
+ this.trace({
29
+ meta: { category: "config" },
30
+ message: `Resolved Rspack configuration: \n${JSON.stringify(omit(options, ["plugins"]), null, 2)}`
31
+ });
32
+ rspack(options);
26
33
  }
27
34
  };
28
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"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 { rspack as build } from \"@rspack/core\";\nimport defu from \"defu\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRspackPlugin } from \"./helpers/unplugin\";\nimport { RspackPluginContext, RspackPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RspackPluginContext = RspackPluginContext\n>(\n options: RspackPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rspack\",\n config() {\n this.debug(\n \"Providing default configuration for the Powerlines `rspack` build plugin.\"\n );\n\n return {\n build: {\n ...options,\n variant: \"rspack\"\n }\n };\n },\n async build() {\n build(\n defu(\n {\n entry: this.entry.reduce(\n (ret, entry) => {\n ret[entry.output || entry.name || entry.file] = entry.file;\n\n return ret;\n },\n {} as Record<string, string>\n )\n },\n resolveOptions(this),\n {\n plugins: [createRspackPlugin(this)]\n }\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AA+BA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO,EACL,OAAO;IACL,GAAG;IACH,SAAS;IACV,EACF;;EAEH,MAAM,QAAQ;AACZ,UACE,KACE,EACE,OAAO,KAAK,MAAM,QACf,KAAK,UAAU;AACd,QAAI,MAAM,UAAU,MAAM,QAAQ,MAAM,QAAQ,MAAM;AAEtD,WAAO;MAET,EAAE,CACH,EACF,EACD,eAAe,KAAK,EACpB,EACE,SAAS,CAAC,mBAAmB,KAAK,CAAC,EACpC,CACF,CACF;;EAEJ"}
1
+ {"version":3,"file":"index.mjs","names":[],"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 { rspack as build } from \"@rspack/core\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport defu from \"defu\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRspackPlugin } from \"./helpers/unplugin\";\nimport { RspackPluginContext, RspackPluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RspackPluginContext = RspackPluginContext\n>(\n options: RspackPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rspack\",\n config() {\n this.debug(\n \"Providing default configuration for the Powerlines `rspack` build plugin.\"\n );\n\n return {\n build: {\n ...options,\n variant: \"rspack\"\n }\n };\n },\n async build() {\n this.debug(\"Starting Rspack build process...\");\n\n const options = defu(\n {\n entry: this.entry.reduce(\n (ret, entry) => {\n ret[entry.output || entry.name || entry.file] = entry.file;\n\n return ret;\n },\n {} as Record<string, string>\n )\n },\n resolveOptions(this),\n {\n plugins: [createRspackPlugin(this)]\n }\n );\n\n this.trace({\n meta: {\n category: \"config\"\n },\n message: `Resolved Rspack configuration: \\n${JSON.stringify(\n omit(options, [\"plugins\"]),\n null,\n 2\n )}`\n });\n\n build(options);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAgCA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,4EACD;AAED,UAAO,EACL,OAAO;IACL,GAAG;IACH,SAAS;IACV,EACF;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,mCAAmC;GAE9C,MAAM,UAAU,KACd,EACE,OAAO,KAAK,MAAM,QACf,KAAK,UAAU;AACd,QAAI,MAAM,UAAU,MAAM,QAAQ,MAAM,QAAQ,MAAM;AAEtD,WAAO;MAET,EAAE,CACH,EACF,EACD,eAAe,KAAK,EACpB,EACE,SAAS,CAAC,mBAAmB,KAAK,CAAC,EACpC,CACF;AAED,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,oCAAoC,KAAK,UAChD,KAAK,SAAS,CAAC,UAAU,CAAC,EAC1B,MACA,EACD;IACF,CAAC;AAEF,UAAM,QAAQ;;EAEjB"}
@@ -1,3 +1,3 @@
1
1
  import { RspackOptions, __ΩRspackOptions } from "./build.cjs";
2
- import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./plugin.cjs";
3
- export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
2
+ import { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./plugin.cjs";
3
+ export { RspackOptions, RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
@@ -1,3 +1,3 @@
1
1
  import { RspackOptions, __ΩRspackOptions } from "./build.mjs";
2
- import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./plugin.mjs";
3
- export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
2
+ import { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./plugin.mjs";
3
+ export { RspackOptions, RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
@@ -1,19 +1,21 @@
1
1
  import { RspackOptions } from "./build.cjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
2
+ import { InitialPluginConfig, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type RspackPluginOptions = Partial<RspackOptions>;
6
6
  interface RspackPluginUserConfig extends UserConfig {
7
7
  rspack?: RspackPluginOptions;
8
8
  }
9
+ type RspackPluginInitialConfig = InitialPluginConfig<RspackPluginUserConfig>;
9
10
  interface RspackPluginResolvedConfig extends ResolvedConfig {
10
11
  rspack: RspackOptions;
11
12
  }
12
13
  type RspackPluginContext<TResolvedConfig extends RspackPluginResolvedConfig = RspackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
14
  declare type __ΩRspackPluginOptions = any[];
14
15
  declare type __ΩRspackPluginUserConfig = any[];
16
+ declare type __ΩRspackPluginInitialConfig = any[];
15
17
  declare type __ΩRspackPluginResolvedConfig = any[];
16
18
  declare type __ΩRspackPluginContext = any[];
17
19
  //#endregion
18
- export { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
20
+ export { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
19
21
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,UAGM,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,yBAAA,GACV,mBAAA,CAAoB,sBAAA;AAAA,UAEL,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1,19 +1,21 @@
1
1
  import { RspackOptions } from "./build.mjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
2
+ import { InitialPluginConfig, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type RspackPluginOptions = Partial<RspackOptions>;
6
6
  interface RspackPluginUserConfig extends UserConfig {
7
7
  rspack?: RspackPluginOptions;
8
8
  }
9
+ type RspackPluginInitialConfig = InitialPluginConfig<RspackPluginUserConfig>;
9
10
  interface RspackPluginResolvedConfig extends ResolvedConfig {
10
11
  rspack: RspackOptions;
11
12
  }
12
13
  type RspackPluginContext<TResolvedConfig extends RspackPluginResolvedConfig = RspackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
14
  declare type __ΩRspackPluginOptions = any[];
14
15
  declare type __ΩRspackPluginUserConfig = any[];
16
+ declare type __ΩRspackPluginInitialConfig = any[];
15
17
  declare type __ΩRspackPluginResolvedConfig = any[];
16
18
  declare type __ΩRspackPluginContext = any[];
17
19
  //#endregion
18
- export { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
20
+ export { RspackPluginContext, RspackPluginInitialConfig, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginInitialConfig, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
19
21
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,UAGM,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGC,yBAAA,GACV,mBAAA,CAAoB,sBAAA;AAAA,UAEL,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-rspack",
3
- "version": "0.5.441",
3
+ "version": "0.5.443",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to build projects using Webpack.",
6
6
  "keywords": ["rspack", "powerlines", "storm-software", "powerlines-plugin"],
@@ -75,11 +75,12 @@
75
75
  "peerDependencies": { "@rspack/core": ">=1.5.0" },
76
76
  "peerDependenciesMeta": { "@rspack/core": { "optional": false } },
77
77
  "dependencies": {
78
- "@powerlines/core": "^0.44.11",
78
+ "@powerlines/core": "^0.45.0",
79
+ "@stryke/helpers": "^0.10.11",
79
80
  "@stryke/path": "^0.28.1",
80
81
  "defu": "^6.1.7"
81
82
  },
82
- "devDependencies": { "@types/node": "^25.6.0", "@rspack/core": "^1.7.11" },
83
+ "devDependencies": { "@rspack/core": "^1.7.11", "@types/node": "^25.6.0" },
83
84
  "publishConfig": { "access": "public" },
84
- "gitHead": "3068780d15828be90a57de9532ed00bd33187340"
85
+ "gitHead": "8a559d0939f118a77d189638644589ce33e56a7e"
85
86
  }