@powerlines/plugin-rspack 0.5.365 → 0.5.367
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/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/helpers/index.cjs +6 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.mts +3 -0
- package/dist/helpers/index.mjs +4 -0
- package/dist/helpers/resolve-options.cjs +39 -0
- package/dist/helpers/resolve-options.d.cts +14 -0
- package/dist/helpers/resolve-options.d.cts.map +1 -0
- package/dist/helpers/resolve-options.d.mts +14 -0
- package/dist/helpers/resolve-options.d.mts.map +1 -0
- package/dist/helpers/resolve-options.mjs +37 -0
- package/dist/helpers/resolve-options.mjs.map +1 -0
- package/dist/helpers/unplugin.cjs +12 -0
- package/dist/helpers/unplugin.d.cts +8 -0
- package/dist/helpers/unplugin.d.cts.map +1 -0
- package/dist/helpers/unplugin.d.mts +8 -0
- package/dist/helpers/unplugin.d.mts.map +1 -0
- package/dist/helpers/unplugin.mjs +11 -0
- package/dist/helpers/unplugin.mjs.map +1 -0
- package/dist/index.cjs +37 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +32 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/build.cjs +0 -0
- package/dist/types/build.d.cts +8 -0
- package/dist/types/build.d.cts.map +1 -0
- package/dist/types/build.d.mts +8 -0
- package/dist/types/build.d.mts.map +1 -0
- package/dist/types/build.mjs +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +19 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +19 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_helpers_resolve_options = require('./resolve-options.cjs');
|
|
3
|
+
const require_helpers_unplugin = require('./unplugin.cjs');
|
|
4
|
+
|
|
5
|
+
exports.createRspackPlugin = require_helpers_unplugin.createRspackPlugin;
|
|
6
|
+
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let defu = require("defu");
|
|
4
|
+
defu = require_runtime.__toESM(defu);
|
|
5
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
6
|
+
|
|
7
|
+
//#region src/helpers/resolve-options.ts
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the options for [rspack](https://rspack.rs/).
|
|
10
|
+
*
|
|
11
|
+
* @param context - The build context.
|
|
12
|
+
* @returns The resolved options.
|
|
13
|
+
*/
|
|
14
|
+
function resolveOptions(context) {
|
|
15
|
+
return (0, defu.default)({ resolve: { alias: context.alias } }, context.config.rspack ? context.config.rspack : {}, {
|
|
16
|
+
external: context.config.resolve.external,
|
|
17
|
+
noExternal: context.config.resolve.noExternal,
|
|
18
|
+
skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle
|
|
19
|
+
}, {
|
|
20
|
+
output: { path: (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.output.path) },
|
|
21
|
+
name: context.config.name,
|
|
22
|
+
node: context.config.platform === "node" ? {
|
|
23
|
+
__dirname: true,
|
|
24
|
+
__filename: true,
|
|
25
|
+
global: true
|
|
26
|
+
} : false,
|
|
27
|
+
mode: context.config.mode === "development" ? "development" : "production",
|
|
28
|
+
recordsInputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rspack", ".rspack-records.json"),
|
|
29
|
+
recordsOutputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rspack", ".rspack-records.json"),
|
|
30
|
+
context: (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root),
|
|
31
|
+
noExternal: context.builtins,
|
|
32
|
+
cache: context.config.mode === "development",
|
|
33
|
+
devtool: context.config.mode !== "development" ? false : "source-map",
|
|
34
|
+
optimization: { minimize: context.config.mode !== "development" }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.resolveOptions = resolveOptions;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "@powerlines/core";
|
|
2
|
+
import { Configuration } from "@rspack/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [rspack](https://rspack.rs/).
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context.
|
|
9
|
+
* @returns The resolved options.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveOptions(context: Context): Configuration;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { resolveOptions };
|
|
14
|
+
//# sourceMappingURL=resolve-options.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;AAiCA;;;;iBAAgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Configuration } from "@rspack/core";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [rspack](https://rspack.rs/).
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context.
|
|
9
|
+
* @returns The resolved options.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveOptions(context: Context): Configuration;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { resolveOptions };
|
|
14
|
+
//# sourceMappingURL=resolve-options.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;AAiCA;;;;iBAAgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import defu from "defu";
|
|
2
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [rspack](https://rspack.rs/).
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context.
|
|
9
|
+
* @returns The resolved options.
|
|
10
|
+
*/
|
|
11
|
+
function resolveOptions(context) {
|
|
12
|
+
return defu({ resolve: { alias: context.alias } }, context.config.rspack ? context.config.rspack : {}, {
|
|
13
|
+
external: context.config.resolve.external,
|
|
14
|
+
noExternal: context.config.resolve.noExternal,
|
|
15
|
+
skipNodeModulesBundle: context.config.resolve.skipNodeModulesBundle
|
|
16
|
+
}, {
|
|
17
|
+
output: { path: joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.path) },
|
|
18
|
+
name: context.config.name,
|
|
19
|
+
node: context.config.platform === "node" ? {
|
|
20
|
+
__dirname: true,
|
|
21
|
+
__filename: true,
|
|
22
|
+
global: true
|
|
23
|
+
} : false,
|
|
24
|
+
mode: context.config.mode === "development" ? "development" : "production",
|
|
25
|
+
recordsInputPath: joinPaths(context.cachePath, "rspack", ".rspack-records.json"),
|
|
26
|
+
recordsOutputPath: joinPaths(context.cachePath, "rspack", ".rspack-records.json"),
|
|
27
|
+
context: joinPaths(context.workspaceConfig.workspaceRoot, context.config.root),
|
|
28
|
+
noExternal: context.builtins,
|
|
29
|
+
cache: context.config.mode === "development",
|
|
30
|
+
devtool: context.config.mode !== "development" ? false : "source-map",
|
|
31
|
+
optimization: { minimize: context.config.mode !== "development" }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { resolveOptions };
|
|
37
|
+
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -0,0 +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 {\n DevTool,\n Configuration as ExternalRspackOptions\n} 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: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.path\n )\n },\n name: context.config.name,\n node:\n context.config.platform === \"node\"\n ? ({\n __dirname: true,\n __filename: true,\n global: true\n } as ExternalRspackOptions[\"node\"])\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(\n context.workspaceConfig.workspaceRoot,\n context.config.root\n ),\n noExternal: context.builtins,\n cache: context.config.mode === \"development\",\n devtool: (context.config.mode !== \"development\"\n ? false\n : \"source-map\") as DevTool | false,\n optimization: {\n minimize: context.config.mode !== \"development\"\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;AAiCA,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,UACJ,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,OAAO,KACvB,EACF;EACD,MAAM,QAAQ,OAAO;EACrB,MACE,QAAQ,OAAO,aAAa,SACvB;GACC,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,UACP,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,KAChB;EACD,YAAY,QAAQ;EACpB,OAAO,QAAQ,OAAO,SAAS;EAC/B,SAAU,QAAQ,OAAO,SAAS,gBAC9B,QACA;EACJ,cAAc,EACZ,UAAU,QAAQ,OAAO,SAAS,eACnC;EACF,CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
4
|
+
let unplugin = require("unplugin");
|
|
5
|
+
|
|
6
|
+
//#region src/helpers/unplugin.ts
|
|
7
|
+
function createRspackPlugin(context) {
|
|
8
|
+
return (0, unplugin.createRspackPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.createRspackPlugin = createRspackPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RspackPluginContext } from "../types/plugin.cjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRspackPlugin(context: RspackPluginContext): unplugin.RspackPluginInstance;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRspackPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,QAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RspackPluginContext } from "../types/plugin.mjs";
|
|
2
|
+
import * as unplugin from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRspackPlugin(context: RspackPluginContext): unplugin.RspackPluginInstance;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRspackPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,QAAA,CAAA,oBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
+
import { createRspackPlugin as createRspackPlugin$1 } from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.ts
|
|
5
|
+
function createRspackPlugin(context) {
|
|
6
|
+
return createRspackPlugin$1(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createRspackPlugin };
|
|
11
|
+
//# sourceMappingURL=unplugin.mjs.map
|
|
@@ -0,0 +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(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAOA,qBAAqB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
|
|
4
|
+
const require_helpers_unplugin = require('./helpers/unplugin.cjs');
|
|
5
|
+
require('./helpers/index.cjs');
|
|
6
|
+
let _rspack_core = require("@rspack/core");
|
|
7
|
+
let defu = require("defu");
|
|
8
|
+
defu = require_runtime.__toESM(defu);
|
|
9
|
+
|
|
10
|
+
//#region src/index.ts
|
|
11
|
+
/**
|
|
12
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
13
|
+
*/
|
|
14
|
+
const plugin = (options = {}) => {
|
|
15
|
+
return {
|
|
16
|
+
name: "rspack",
|
|
17
|
+
config() {
|
|
18
|
+
this.debug("Providing default configuration for the Powerlines `rspack` build plugin.");
|
|
19
|
+
return { build: {
|
|
20
|
+
...options,
|
|
21
|
+
variant: "rspack"
|
|
22
|
+
} };
|
|
23
|
+
},
|
|
24
|
+
async build() {
|
|
25
|
+
(0, _rspack_core.rspack)((0, defu.default)({ entry: this.entry.reduce((ret, entry) => {
|
|
26
|
+
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
27
|
+
return ret;
|
|
28
|
+
}, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createRspackPlugin(this)] }));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.createRspackPlugin = require_helpers_unplugin.createRspackPlugin;
|
|
35
|
+
exports.default = plugin;
|
|
36
|
+
exports.plugin = plugin;
|
|
37
|
+
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.cjs";
|
|
2
|
+
import { RspackOptions, __ΩRspackOptions } from "./types/build.cjs";
|
|
3
|
+
import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.cjs";
|
|
4
|
+
import { createRspackPlugin } from "./helpers/unplugin.cjs";
|
|
5
|
+
import { Plugin } from "@powerlines/core";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
10
|
+
*/
|
|
11
|
+
declare const plugin: <TContext extends RspackPluginContext = RspackPluginContext>(options?: RspackPluginOptions) => Plugin<TContext>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
|
|
14
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cAmCa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { RspackOptions, __ΩRspackOptions } from "./types/build.mjs";
|
|
3
|
+
import { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
+
import { createRspackPlugin } from "./helpers/unplugin.mjs";
|
|
5
|
+
import { Plugin } from "@powerlines/core";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
10
|
+
*/
|
|
11
|
+
declare const plugin: <TContext extends RspackPluginContext = RspackPluginContext>(options?: RspackPluginOptions) => Plugin<TContext>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { RspackOptions, RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackOptions, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig, createRspackPlugin, plugin as default, plugin, resolveOptions };
|
|
14
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;cAmCa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { createRspackPlugin } from "./helpers/unplugin.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
4
|
+
import { rspack } from "@rspack/core";
|
|
5
|
+
import defu from "defu";
|
|
6
|
+
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
10
|
+
*/
|
|
11
|
+
const plugin = (options = {}) => {
|
|
12
|
+
return {
|
|
13
|
+
name: "rspack",
|
|
14
|
+
config() {
|
|
15
|
+
this.debug("Providing default configuration for the Powerlines `rspack` build plugin.");
|
|
16
|
+
return { build: {
|
|
17
|
+
...options,
|
|
18
|
+
variant: "rspack"
|
|
19
|
+
} };
|
|
20
|
+
},
|
|
21
|
+
async build() {
|
|
22
|
+
rspack(defu({ entry: this.entry.reduce((ret, entry) => {
|
|
23
|
+
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
24
|
+
return ret;
|
|
25
|
+
}, {}) }, resolveOptions(this), { plugins: [createRspackPlugin(this)] }));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { createRspackPlugin, plugin as default, plugin, resolveOptions };
|
|
32
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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 {\n RspackPluginContext,\n RspackPluginOptions,\n RspackPluginResolvedConfig\n} 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 } as Partial<RspackPluginResolvedConfig>;\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":";;;;;;;;;;AAmCA,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"}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration } from "@rspack/core";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RspackOptions = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external">;
|
|
5
|
+
declare type __ΩRspackOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { RspackOptions, __ΩRspackOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,aAAA,GAAgB,IAAA,CAC1B,aAAA;AAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration } from "@rspack/core";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RspackOptions = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external">;
|
|
5
|
+
declare type __ΩRspackOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { RspackOptions, __ΩRspackOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,aAAA,GAAgB,IAAA,CAC1B,aAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
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 };
|
|
@@ -0,0 +1,3 @@
|
|
|
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RspackOptions } from "./build.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type RspackPluginOptions = Partial<RspackOptions>;
|
|
6
|
+
interface RspackPluginUserConfig extends UserConfig {
|
|
7
|
+
rspack?: RspackPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface RspackPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
rspack: RspackOptions;
|
|
11
|
+
}
|
|
12
|
+
type RspackPluginContext<TResolvedConfig extends RspackPluginResolvedConfig = RspackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩRspackPluginOptions = any[];
|
|
14
|
+
declare type __ΩRspackPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩRspackPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩRspackPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RspackOptions } from "./build.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type RspackPluginOptions = Partial<RspackOptions>;
|
|
6
|
+
interface RspackPluginUserConfig extends UserConfig {
|
|
7
|
+
rspack?: RspackPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface RspackPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
rspack: RspackOptions;
|
|
11
|
+
}
|
|
12
|
+
type RspackPluginContext<TResolvedConfig extends RspackPluginResolvedConfig = RspackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩRspackPluginOptions = any[];
|
|
14
|
+
declare type __ΩRspackPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩRspackPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩRspackPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RspackPluginContext, RspackPluginOptions, RspackPluginResolvedConfig, RspackPluginUserConfig, __ΩRspackPluginContext, __ΩRspackPluginOptions, __ΩRspackPluginResolvedConfig, __ΩRspackPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rspack",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.367",
|
|
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,11 @@
|
|
|
75
75
|
"peerDependencies": { "@rspack/core": ">=1.5.0" },
|
|
76
76
|
"peerDependenciesMeta": { "@rspack/core": { "optional": false } },
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@powerlines/core": "^0.
|
|
78
|
+
"@powerlines/core": "^0.8.1",
|
|
79
79
|
"@stryke/path": "^0.27.2",
|
|
80
80
|
"defu": "^6.1.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": { "@types/node": "^25.5.0", "@rspack/core": "^1.7.9" },
|
|
83
83
|
"publishConfig": { "access": "public" },
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "af94c1952c9f2d293dac72a2d0ed3627be8d807d"
|
|
85
85
|
}
|