@powerlines/plugin-webpack 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 +35 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +29 -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 +2 -0
- package/dist/types/index.d.mts +2 -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.createWebpackPlugin = require_helpers_unplugin.createWebpackPlugin;
|
|
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 [webpack](https://webpack.js.org/).
|
|
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.webpack ? context.config.webpack : {}, {
|
|
16
|
+
output: { path: (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.output.path) },
|
|
17
|
+
name: context.config.name,
|
|
18
|
+
plugins: context.config.webpack?.plugins ?? [],
|
|
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
|
+
cache: {
|
|
26
|
+
type: "filesystem",
|
|
27
|
+
cacheDirectory: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "webpack", "cache")
|
|
28
|
+
},
|
|
29
|
+
recordsInputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "webpack", ".webpack-records.json"),
|
|
30
|
+
recordsOutputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "webpack", ".webpack-records.json"),
|
|
31
|
+
context: (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root),
|
|
32
|
+
noExternal: context.builtins,
|
|
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 "webpack";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [webpack](https://webpack.js.org/).
|
|
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":";;;;;;AA8BA;;;;iBAAgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Configuration } from "webpack";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [webpack](https://webpack.js.org/).
|
|
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":";;;;;;AA8BA;;;;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 [webpack](https://webpack.js.org/).
|
|
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.webpack ? context.config.webpack : {}, {
|
|
13
|
+
output: { path: joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.path) },
|
|
14
|
+
name: context.config.name,
|
|
15
|
+
plugins: context.config.webpack?.plugins ?? [],
|
|
16
|
+
node: context.config.platform === "node" ? {
|
|
17
|
+
__dirname: true,
|
|
18
|
+
__filename: true,
|
|
19
|
+
global: true
|
|
20
|
+
} : false,
|
|
21
|
+
mode: context.config.mode === "development" ? "development" : "production",
|
|
22
|
+
cache: {
|
|
23
|
+
type: "filesystem",
|
|
24
|
+
cacheDirectory: joinPaths(context.cachePath, "webpack", "cache")
|
|
25
|
+
},
|
|
26
|
+
recordsInputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
|
|
27
|
+
recordsOutputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
|
|
28
|
+
context: joinPaths(context.workspaceConfig.workspaceRoot, context.config.root),
|
|
29
|
+
noExternal: context.builtins,
|
|
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 { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport type { Configuration as ExternalWebpackOptions } from \"webpack\";\nimport { WebpackPluginResolvedConfig } from \"../types\";\n\n/**\n * Resolves the options for [webpack](https://webpack.js.org/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ExternalWebpackOptions {\n return defu(\n {\n resolve: {\n alias: context.alias\n }\n },\n (context.config as WebpackPluginResolvedConfig).webpack\n ? (context.config as WebpackPluginResolvedConfig).webpack\n : {},\n {\n output: {\n path: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.output.path\n )\n },\n name: context.config.name,\n plugins:\n (context.config as WebpackPluginResolvedConfig).webpack?.plugins ?? [],\n node:\n context.config.platform === \"node\"\n ? ({\n __dirname: true,\n __filename: true,\n global: true\n } as ExternalWebpackOptions[\"node\"])\n : false,\n mode:\n context.config.mode === \"development\"\n ? (\"development\" as const)\n : (\"production\" as const),\n cache: {\n type: \"filesystem\" as const,\n cacheDirectory: joinPaths(context.cachePath, \"webpack\", \"cache\")\n },\n recordsInputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n recordsOutputPath: joinPaths(\n context.cachePath,\n \"webpack\",\n \".webpack-records.json\"\n ),\n context: joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root\n ),\n noExternal: context.builtins,\n devtool: (context.config.mode !== \"development\"\n ? false\n : \"source-map\") as string | false,\n optimization: {\n minimize: context.config.mode !== \"development\"\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,eAAe,SAA0C;AACvE,QAAO,KACL,EACE,SAAS,EACP,OAAO,QAAQ,OAChB,EACF,EACA,QAAQ,OAAuC,UAC3C,QAAQ,OAAuC,UAChD,EAAE,EACN;EACE,QAAQ,EACN,MAAM,UACJ,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,OAAO,KACvB,EACF;EACD,MAAM,QAAQ,OAAO;EACrB,SACG,QAAQ,OAAuC,SAAS,WAAW,EAAE;EACxE,MACE,QAAQ,OAAO,aAAa,SACvB;GACC,WAAW;GACX,YAAY;GACZ,QAAQ;GACT,GACD;EACN,MACE,QAAQ,OAAO,SAAS,gBACnB,gBACA;EACP,OAAO;GACL,MAAM;GACN,gBAAgB,UAAU,QAAQ,WAAW,WAAW,QAAQ;GACjE;EACD,kBAAkB,UAChB,QAAQ,WACR,WACA,wBACD;EACD,mBAAmB,UACjB,QAAQ,WACR,WACA,wBACD;EACD,SAAS,UACP,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,KAChB;EACD,YAAY,QAAQ;EACpB,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 createWebpackPlugin(context) {
|
|
8
|
+
return (0, unplugin.createWebpackPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.createWebpackPlugin = createWebpackPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebpackPluginContext } from "../types/plugin.cjs";
|
|
2
|
+
import * as webpack from "webpack";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createWebpackPlugin(context: WebpackPluginContext): webpack.WebpackPluginInstance;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createWebpackPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAoB,OAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebpackPluginContext } from "../types/plugin.mjs";
|
|
2
|
+
import * as webpack from "webpack";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createWebpackPlugin(context: WebpackPluginContext): webpack.WebpackPluginInstance;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createWebpackPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAoB,OAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
+
import { createWebpackPlugin as createWebpackPlugin$1 } from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.ts
|
|
5
|
+
function createWebpackPlugin(context) {
|
|
6
|
+
return createWebpackPlugin$1(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createWebpackPlugin };
|
|
11
|
+
//# sourceMappingURL=unplugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.mjs","names":["createWebpackUnplugin"],"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 { createWebpackPlugin as createWebpackUnplugin } from \"unplugin\";\nimport { WebpackPluginContext } from \"../types/plugin\";\n\nexport function createWebpackPlugin(context: WebpackPluginContext) {\n return createWebpackUnplugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,oBAAoB,SAA+B;AACjE,QAAOA,sBAAsB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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 defu = require("defu");
|
|
7
|
+
defu = require_runtime.__toESM(defu);
|
|
8
|
+
let webpack = require("webpack");
|
|
9
|
+
webpack = require_runtime.__toESM(webpack);
|
|
10
|
+
|
|
11
|
+
//#region src/index.ts
|
|
12
|
+
/**
|
|
13
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
14
|
+
*/
|
|
15
|
+
const plugin = (options = {}) => {
|
|
16
|
+
return {
|
|
17
|
+
name: "webpack",
|
|
18
|
+
config() {
|
|
19
|
+
this.trace("Providing default configuration for the Powerlines `webpack` build plugin.");
|
|
20
|
+
return { webpack: { ...options } };
|
|
21
|
+
},
|
|
22
|
+
async build() {
|
|
23
|
+
(0, webpack.default)((0, defu.default)({ entry: this.entry.reduce((ret, entry) => {
|
|
24
|
+
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
25
|
+
return ret;
|
|
26
|
+
}, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createWebpackPlugin(this)] }));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.createWebpackPlugin = require_helpers_unplugin.createWebpackPlugin;
|
|
33
|
+
exports.default = plugin;
|
|
34
|
+
exports.plugin = plugin;
|
|
35
|
+
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.cjs";
|
|
2
|
+
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.cjs";
|
|
3
|
+
import { createWebpackPlugin } from "./helpers/unplugin.cjs";
|
|
4
|
+
import { Plugin } from "@powerlines/core";
|
|
5
|
+
|
|
6
|
+
//#region src/index.d.ts
|
|
7
|
+
declare module "@powerlines/core" {
|
|
8
|
+
interface Config {
|
|
9
|
+
webpack?: WebpackPluginOptions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
14
|
+
*/
|
|
15
|
+
declare const plugin: <TContext extends WebpackPluginContext = WebpackPluginContext>(options?: WebpackPluginOptions) => Plugin<TContext>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
18
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;YAiCY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;cAOD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.mjs";
|
|
3
|
+
import { createWebpackPlugin } from "./helpers/unplugin.mjs";
|
|
4
|
+
import { Plugin } from "@powerlines/core";
|
|
5
|
+
|
|
6
|
+
//#region src/index.d.ts
|
|
7
|
+
declare module "@powerlines/core" {
|
|
8
|
+
interface Config {
|
|
9
|
+
webpack?: WebpackPluginOptions;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
14
|
+
*/
|
|
15
|
+
declare const plugin: <TContext extends WebpackPluginContext = WebpackPluginContext>(options?: WebpackPluginOptions) => Plugin<TContext>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
18
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;YAiCY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;cAOD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { createWebpackPlugin } from "./helpers/unplugin.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
4
|
+
import defu from "defu";
|
|
5
|
+
import build from "webpack";
|
|
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: "webpack",
|
|
14
|
+
config() {
|
|
15
|
+
this.trace("Providing default configuration for the Powerlines `webpack` build plugin.");
|
|
16
|
+
return { webpack: { ...options } };
|
|
17
|
+
},
|
|
18
|
+
async build() {
|
|
19
|
+
build(defu({ entry: this.entry.reduce((ret, entry) => {
|
|
20
|
+
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
21
|
+
return ret;
|
|
22
|
+
}, {}) }, resolveOptions(this), { plugins: [createWebpackPlugin(this)] }));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
29
|
+
//# 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 defu from \"defu\";\nimport build from \"webpack\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createWebpackPlugin } from \"./helpers/unplugin\";\nimport {\n WebpackPluginContext,\n WebpackPluginOptions,\n WebpackPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n webpack?: WebpackPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends WebpackPluginContext = WebpackPluginContext\n>(\n options: WebpackPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"webpack\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `webpack` build plugin.\"\n );\n\n return {\n webpack: {\n ...options\n }\n } as Partial<WebpackPluginResolvedConfig>;\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: [createWebpackPlugin(this)]\n }\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAyCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,6EACD;AAED,UAAO,EACL,SAAS,EACP,GAAG,SACJ,EACF;;EAEH,MAAM,QAAQ;AACZ,SACE,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,oBAAoB,KAAK,CAAC,EACrC,CACF,CACF;;EAEJ"}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration } from "webpack";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type WebpackOptions = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external">;
|
|
5
|
+
declare type __ΩWebpackOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { WebpackOptions, __ΩWebpackOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,IAAA,CAC3B,aAAA;AAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration } from "webpack";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type WebpackOptions = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external">;
|
|
5
|
+
declare type __ΩWebpackOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { WebpackOptions, __ΩWebpackOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,IAAA,CAC3B,aAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WebpackOptions } from "./build.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type WebpackPluginOptions = Partial<WebpackOptions>;
|
|
6
|
+
interface WebpackPluginUserConfig extends UserConfig {
|
|
7
|
+
webpack?: WebpackPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface WebpackPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
webpack: WebpackOptions;
|
|
11
|
+
}
|
|
12
|
+
type WebpackPluginContext<TResolvedConfig extends WebpackPluginResolvedConfig = WebpackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩWebpackPluginOptions = any[];
|
|
14
|
+
declare type __ΩWebpackPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩWebpackPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩWebpackPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,UAGK,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WebpackOptions } from "./build.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type WebpackPluginOptions = Partial<WebpackOptions>;
|
|
6
|
+
interface WebpackPluginUserConfig extends UserConfig {
|
|
7
|
+
webpack?: WebpackPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface WebpackPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
webpack: WebpackOptions;
|
|
11
|
+
}
|
|
12
|
+
type WebpackPluginContext<TResolvedConfig extends WebpackPluginResolvedConfig = WebpackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩWebpackPluginOptions = any[];
|
|
14
|
+
declare type __ΩWebpackPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩWebpackPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩWebpackPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,UAGK,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,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-webpack",
|
|
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": ["webpack", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"typings": "dist/index.d.mts",
|
|
74
74
|
"files": ["dist/**/*"],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@powerlines/core": "^0.
|
|
76
|
+
"@powerlines/core": "^0.8.1",
|
|
77
77
|
"@stryke/path": "^0.27.2",
|
|
78
78
|
"defu": "^6.1.4",
|
|
79
79
|
"unplugin": "^3.0.0"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"peerDependencies": { "webpack": ">=5.101.0" },
|
|
83
83
|
"peerDependenciesMeta": { "webpack": { "optional": false } },
|
|
84
84
|
"publishConfig": { "access": "public" },
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "af94c1952c9f2d293dac72a2d0ed3627be8d807d"
|
|
86
86
|
}
|