@powerlines/plugin-webpack 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.
- package/dist/helpers/resolve-options.cjs +1 -1
- package/dist/helpers/resolve-options.mjs +1 -1
- package/dist/helpers/resolve-options.mjs.map +1 -1
- package/dist/helpers/unplugin.cjs +4 -1
- package/dist/helpers/unplugin.mjs +4 -1
- package/dist/helpers/unplugin.mjs.map +1 -1
- package/dist/index.cjs +9 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +4 -2
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +4 -2
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +4 -3
|
@@ -31,7 +31,7 @@ function resolveOptions(context) {
|
|
|
31
31
|
context: (0, _stryke_path_join_paths.joinPaths)(context.config.cwd, context.config.root),
|
|
32
32
|
noExternal: context.builtins,
|
|
33
33
|
devtool: context.config.output.sourceMap ? "source-map" : false,
|
|
34
|
-
optimization: { minimize: context.config.output.minify
|
|
34
|
+
optimization: { minimize: context.config.output.minify }
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -28,7 +28,7 @@ function resolveOptions(context) {
|
|
|
28
28
|
context: joinPaths(context.config.cwd, context.config.root),
|
|
29
29
|
noExternal: context.builtins,
|
|
30
30
|
devtool: context.config.output.sourceMap ? "source-map" : false,
|
|
31
|
-
optimization: { minimize: context.config.output.minify
|
|
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 { 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: context.config.output.path\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 }\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(context.config.cwd, context.config.root),\n noExternal: context.builtins,\n devtool: context.config.output.sourceMap ? \"source-map\" : false,\n optimization: {\n minimize
|
|
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: context.config.output.path\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 }\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(context.config.cwd, context.config.root),\n noExternal: context.builtins,\n devtool: context.config.output.sourceMap ? \"source-map\" : false,\n optimization: {\n minimize: context.config.output.minify\n }\n }\n ) as ExternalWebpackOptions;\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,QAAQ,OAAO,OAAO,MAC7B;EACD,MAAM,QAAQ,OAAO;EACrB,SACG,QAAQ,OAAuC,SAAS,WAAW,EAAE;EACxE,MACE,QAAQ,OAAO,aAAa,SACxB;GACE,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,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,KAAK;EAC3D,YAAY,QAAQ;EACpB,SAAS,QAAQ,OAAO,OAAO,YAAY,eAAe;EAC1D,cAAc,EACZ,UAAU,QAAQ,OAAO,OAAO,QACjC;EACF,CACF"}
|
|
@@ -8,7 +8,10 @@ function createWebpackPlugin(context) {
|
|
|
8
8
|
return (0, unplugin.createWebpackPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context, {
|
|
9
9
|
silenceHookLogging: true,
|
|
10
10
|
name: "webpack"
|
|
11
|
-
}))({
|
|
11
|
+
}))({
|
|
12
|
+
...context.options,
|
|
13
|
+
...context.initialConfig
|
|
14
|
+
});
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
//#endregion
|
|
@@ -1 +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(\n createUnplugin(context, { silenceHookLogging: true, name: \"webpack\" })\n )({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,oBAAoB,SAA+B;AACjE,QAAOA,sBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAW,CAAC,CACvE,CAAC
|
|
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(\n createUnplugin(context, { silenceHookLogging: true, name: \"webpack\" })\n )({ ...context.options, ...context.initialConfig });\n}\n"],"mappings":";;;;AAsBA,SAAgB,oBAAoB,SAA+B;AACjE,QAAOA,sBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAW,CAAC,CACvE,CAAC;EAAE,GAAG,QAAQ;EAAS,GAAG,QAAQ;EAAe,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
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
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
6
7
|
let defu = require("defu");
|
|
7
8
|
defu = require_runtime.__toESM(defu, 1);
|
|
8
9
|
let webpack = require("webpack");
|
|
@@ -20,10 +21,16 @@ const plugin = (options = {}) => {
|
|
|
20
21
|
return { webpack: { ...options } };
|
|
21
22
|
},
|
|
22
23
|
async build() {
|
|
23
|
-
|
|
24
|
+
this.debug("Starting Webpack build process...");
|
|
25
|
+
const options = (0, defu.default)({ entry: this.entry.reduce((ret, entry) => {
|
|
24
26
|
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
25
27
|
return ret;
|
|
26
|
-
}, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createWebpackPlugin(this)] })
|
|
28
|
+
}, {}) }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createWebpackPlugin(this)] });
|
|
29
|
+
this.trace({
|
|
30
|
+
meta: { category: "config" },
|
|
31
|
+
message: `Resolved Webpack configuration: \n${JSON.stringify((0, _stryke_helpers_omit.omit)(options, ["plugins"]), null, 2)}`
|
|
32
|
+
});
|
|
33
|
+
(0, webpack.default)(options);
|
|
27
34
|
}
|
|
28
35
|
};
|
|
29
36
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveOptions } from "./helpers/resolve-options.cjs";
|
|
2
|
-
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
+
import { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.cjs";
|
|
3
3
|
import { createWebpackPlugin } from "./helpers/unplugin.cjs";
|
|
4
4
|
import { Plugin } from "@powerlines/core";
|
|
5
5
|
|
|
@@ -14,5 +14,5 @@ declare module "@powerlines/core" {
|
|
|
14
14
|
*/
|
|
15
15
|
declare const plugin: <TContext extends WebpackPluginContext = WebpackPluginContext>(options?: WebpackPluginOptions) => Plugin<TContext>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
17
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
18
18
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;YA8BY,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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
-
import { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
+
import { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./types/plugin.mjs";
|
|
3
3
|
import { createWebpackPlugin } from "./helpers/unplugin.mjs";
|
|
4
4
|
import { Plugin } from "@powerlines/core";
|
|
5
5
|
|
|
@@ -14,5 +14,5 @@ declare module "@powerlines/core" {
|
|
|
14
14
|
*/
|
|
15
15
|
declare const plugin: <TContext extends WebpackPluginContext = WebpackPluginContext>(options?: WebpackPluginOptions) => Plugin<TContext>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
17
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig, createWebpackPlugin, plugin as default, plugin, resolveOptions };
|
|
18
18
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;YA8BY,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
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
2
|
import { createWebpackPlugin } from "./helpers/unplugin.mjs";
|
|
3
3
|
import "./helpers/index.mjs";
|
|
4
|
+
import { omit } from "@stryke/helpers/omit";
|
|
4
5
|
import defu from "defu";
|
|
5
|
-
import
|
|
6
|
+
import webpack from "webpack";
|
|
6
7
|
|
|
7
8
|
//#region src/index.ts
|
|
8
9
|
/**
|
|
@@ -16,10 +17,16 @@ const plugin = (options = {}) => {
|
|
|
16
17
|
return { webpack: { ...options } };
|
|
17
18
|
},
|
|
18
19
|
async build() {
|
|
19
|
-
|
|
20
|
+
this.debug("Starting Webpack build process...");
|
|
21
|
+
const options = defu({ entry: this.entry.reduce((ret, entry) => {
|
|
20
22
|
ret[entry.output || entry.name || entry.file] = entry.file;
|
|
21
23
|
return ret;
|
|
22
|
-
}, {}) }, resolveOptions(this), { plugins: [createWebpackPlugin(this)] })
|
|
24
|
+
}, {}) }, resolveOptions(this), { plugins: [createWebpackPlugin(this)] });
|
|
25
|
+
this.trace({
|
|
26
|
+
meta: { category: "config" },
|
|
27
|
+
message: `Resolved Webpack configuration: \n${JSON.stringify(omit(options, ["plugins"]), null, 2)}`
|
|
28
|
+
});
|
|
29
|
+
webpack(options);
|
|
23
30
|
}
|
|
24
31
|
};
|
|
25
32
|
};
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 defu from \"defu\";\nimport
|
|
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 { omit } from \"@stryke/helpers/omit\";\nimport defu from \"defu\";\nimport webpack from \"webpack\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createWebpackPlugin } from \"./helpers/unplugin\";\nimport { WebpackPluginContext, WebpackPluginOptions } 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 };\n },\n async build() {\n this.debug(\"Starting Webpack 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: [createWebpackPlugin(this)]\n }\n );\n\n this.trace({\n meta: {\n category: \"config\"\n },\n message: `Resolved Webpack configuration: \\n${JSON.stringify(\n omit(options, [\"plugins\"]),\n null,\n 2\n )}`\n });\n\n webpack(options);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAsCA,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,QAAK,MAAM,oCAAoC;GAE/C,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,oBAAoB,KAAK,CAAC,EACrC,CACF;AAED,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,qCAAqC,KAAK,UACjD,KAAK,SAAS,CAAC,UAAU,CAAC,EAC1B,MACA,EACD;IACF,CAAC;AAEF,WAAQ,QAAQ;;EAEnB"}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +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 };
|
|
1
|
+
import { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +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 };
|
|
1
|
+
import { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { WebpackOptions } 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 WebpackPluginOptions = Partial<WebpackOptions>;
|
|
6
6
|
interface WebpackPluginUserConfig extends UserConfig {
|
|
7
7
|
webpack?: WebpackPluginOptions;
|
|
8
8
|
}
|
|
9
|
+
type WebpackPluginInitialConfig = InitialPluginConfig<WebpackPluginUserConfig>;
|
|
9
10
|
interface WebpackPluginResolvedConfig extends ResolvedConfig {
|
|
10
11
|
webpack: WebpackOptions;
|
|
11
12
|
}
|
|
12
13
|
type WebpackPluginContext<TResolvedConfig extends WebpackPluginResolvedConfig = WebpackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
14
|
declare type __ΩWebpackPluginOptions = any[];
|
|
14
15
|
declare type __ΩWebpackPluginUserConfig = any[];
|
|
16
|
+
declare type __ΩWebpackPluginInitialConfig = any[];
|
|
15
17
|
declare type __ΩWebpackPluginResolvedConfig = any[];
|
|
16
18
|
declare type __ΩWebpackPluginContext = any[];
|
|
17
19
|
//#endregion
|
|
18
|
-
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
20
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
19
21
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,0BAAA,GACV,mBAAA,CAAoB,uBAAA;AAAA,UAEL,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { WebpackOptions } 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 WebpackPluginOptions = Partial<WebpackOptions>;
|
|
6
6
|
interface WebpackPluginUserConfig extends UserConfig {
|
|
7
7
|
webpack?: WebpackPluginOptions;
|
|
8
8
|
}
|
|
9
|
+
type WebpackPluginInitialConfig = InitialPluginConfig<WebpackPluginUserConfig>;
|
|
9
10
|
interface WebpackPluginResolvedConfig extends ResolvedConfig {
|
|
10
11
|
webpack: WebpackOptions;
|
|
11
12
|
}
|
|
12
13
|
type WebpackPluginContext<TResolvedConfig extends WebpackPluginResolvedConfig = WebpackPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
14
|
declare type __ΩWebpackPluginOptions = any[];
|
|
14
15
|
declare type __ΩWebpackPluginUserConfig = any[];
|
|
16
|
+
declare type __ΩWebpackPluginInitialConfig = any[];
|
|
15
17
|
declare type __ΩWebpackPluginResolvedConfig = any[];
|
|
16
18
|
declare type __ΩWebpackPluginContext = any[];
|
|
17
19
|
//#endregion
|
|
18
|
-
export { WebpackPluginContext, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
20
|
+
export { WebpackPluginContext, WebpackPluginInitialConfig, WebpackPluginOptions, WebpackPluginResolvedConfig, WebpackPluginUserConfig, __ΩWebpackPluginContext, __ΩWebpackPluginInitialConfig, __ΩWebpackPluginOptions, __ΩWebpackPluginResolvedConfig, __ΩWebpackPluginUserConfig };
|
|
19
21
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,0BAAA,GACV,mBAAA,CAAoB,uBAAA;AAAA,UAEL,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-webpack",
|
|
3
|
-
"version": "0.5.
|
|
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": ["webpack", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
"typings": "dist/index.d.mts",
|
|
74
74
|
"files": ["dist/**/*"],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@powerlines/core": "^0.
|
|
76
|
+
"@powerlines/core": "^0.45.0",
|
|
77
|
+
"@stryke/helpers": "^0.10.11",
|
|
77
78
|
"@stryke/path": "^0.28.1",
|
|
78
79
|
"defu": "^6.1.7",
|
|
79
80
|
"unplugin": "^3.0.0"
|
|
@@ -82,5 +83,5 @@
|
|
|
82
83
|
"peerDependencies": { "webpack": ">=5.101.0" },
|
|
83
84
|
"peerDependenciesMeta": { "webpack": { "optional": false } },
|
|
84
85
|
"publishConfig": { "access": "public" },
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "8a559d0939f118a77d189638644589ce33e56a7e"
|
|
86
87
|
}
|