@powerlines/plugin-webpack 0.5.441 → 0.5.442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/index.cjs +9 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.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"}
|
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.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.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-webpack",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.442",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to build projects using Webpack.",
|
|
6
6
|
"keywords": ["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.44.
|
|
76
|
+
"@powerlines/core": "^0.44.12",
|
|
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": "93fe3bf5054baa0bb1841c64fe082da56631a010"
|
|
86
87
|
}
|