@powerlines/plugin-webpack 0.5.395 → 0.5.396
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.
|
@@ -13,7 +13,7 @@ let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
|
13
13
|
*/
|
|
14
14
|
function resolveOptions(context) {
|
|
15
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.
|
|
16
|
+
output: { path: (0, _stryke_path_join_paths.joinPaths)(context.config.cwd, context.config.output.path) },
|
|
17
17
|
name: context.config.name,
|
|
18
18
|
plugins: context.config.webpack?.plugins ?? [],
|
|
19
19
|
node: context.config.platform === "node" ? {
|
|
@@ -28,10 +28,10 @@ function resolveOptions(context) {
|
|
|
28
28
|
},
|
|
29
29
|
recordsInputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "webpack", ".webpack-records.json"),
|
|
30
30
|
recordsOutputPath: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "webpack", ".webpack-records.json"),
|
|
31
|
-
context: (0, _stryke_path_join_paths.joinPaths)(context.
|
|
31
|
+
context: (0, _stryke_path_join_paths.joinPaths)(context.config.cwd, context.config.root),
|
|
32
32
|
noExternal: context.builtins,
|
|
33
|
-
devtool: context.config.
|
|
34
|
-
optimization: { minimize: context.config.mode !== "development" }
|
|
33
|
+
devtool: context.config.output.sourceMap ? "source-map" : false,
|
|
34
|
+
optimization: { minimize: context.config.output.minify ?? context.config.mode !== "development" }
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -10,7 +10,7 @@ import { joinPaths } from "@stryke/path/join-paths";
|
|
|
10
10
|
*/
|
|
11
11
|
function resolveOptions(context) {
|
|
12
12
|
return defu({ resolve: { alias: context.alias } }, context.config.webpack ? context.config.webpack : {}, {
|
|
13
|
-
output: { path: joinPaths(context.
|
|
13
|
+
output: { path: joinPaths(context.config.cwd, context.config.output.path) },
|
|
14
14
|
name: context.config.name,
|
|
15
15
|
plugins: context.config.webpack?.plugins ?? [],
|
|
16
16
|
node: context.config.platform === "node" ? {
|
|
@@ -25,10 +25,10 @@ function resolveOptions(context) {
|
|
|
25
25
|
},
|
|
26
26
|
recordsInputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
|
|
27
27
|
recordsOutputPath: joinPaths(context.cachePath, "webpack", ".webpack-records.json"),
|
|
28
|
-
context: joinPaths(context.
|
|
28
|
+
context: joinPaths(context.config.cwd, context.config.root),
|
|
29
29
|
noExternal: context.builtins,
|
|
30
|
-
devtool: context.config.
|
|
31
|
-
optimization: { minimize: context.config.mode !== "development" }
|
|
30
|
+
devtool: context.config.output.sourceMap ? "source-map" : false,
|
|
31
|
+
optimization: { minimize: context.config.output.minify ?? context.config.mode !== "development" }
|
|
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: joinPaths(
|
|
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(context.config.cwd, 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:\n context.config.output.minify ?? 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,UAAU,QAAQ,OAAO,KAAK,QAAQ,OAAO,OAAO,KAAK,EAChE;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,UACE,QAAQ,OAAO,OAAO,UAAU,QAAQ,OAAO,SAAS,eAC3D;EACF,CACF"}
|
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":";;;;;;;YA6BY,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":";;;;;;;YA6BY,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.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 build from \"webpack\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createWebpackPlugin } from \"./helpers/unplugin\";\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 defu from \"defu\";\nimport build 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 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":";;;;;;;;;;AAqCA,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-webpack",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.396",
|
|
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.13.
|
|
76
|
+
"@powerlines/core": "^0.13.13",
|
|
77
77
|
"@stryke/path": "^0.27.4",
|
|
78
78
|
"defu": "^6.1.7",
|
|
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": "49eae5ce8145cd6ae873cb4d9b3d747f7132c82d"
|
|
86
86
|
}
|