@powerlines/plugin-rspack 0.5.441 → 0.5.442

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"}
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
  };
@@ -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"}
@@ -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"}
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.442",
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.44.12",
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": "93fe3bf5054baa0bb1841c64fe082da56631a010"
85
86
  }