powerlines 0.40.1 → 0.40.2

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.
Files changed (80) hide show
  1. package/dist/{api-D1TJOJXE.mjs → api-CHXfSSj6.mjs} +102 -54
  2. package/dist/api-CHXfSSj6.mjs.map +1 -0
  3. package/dist/{api-CMgoAQum.cjs → api-DtumO6qc.cjs} +101 -53
  4. package/dist/astro.cjs +2 -2
  5. package/dist/astro.d.mts +1 -1
  6. package/dist/astro.mjs +2 -2
  7. package/dist/context/index.cjs +1 -1
  8. package/dist/context/index.d.cts +20 -0
  9. package/dist/context/index.d.cts.map +1 -1
  10. package/dist/context/index.d.mts +21 -1
  11. package/dist/context/index.d.mts.map +1 -1
  12. package/dist/context/index.mjs +1 -1
  13. package/dist/{esbuild-B8xqzmmF.cjs → esbuild-BVasizva.cjs} +1 -1
  14. package/dist/{esbuild-Bo7TrGmt.mjs → esbuild-ChH1x8Hc.mjs} +2 -2
  15. package/dist/{esbuild-Bo7TrGmt.mjs.map → esbuild-ChH1x8Hc.mjs.map} +1 -1
  16. package/dist/esbuild.cjs +2 -2
  17. package/dist/esbuild.d.mts +1 -1
  18. package/dist/esbuild.mjs +2 -2
  19. package/dist/farm.cjs +1 -1
  20. package/dist/farm.d.mts +1 -1
  21. package/dist/farm.mjs +1 -1
  22. package/dist/{index-Dqk6Rh9U.d.mts → index-BbFz3REx.d.mts} +2 -2
  23. package/dist/{index-Dqk6Rh9U.d.mts.map → index-BbFz3REx.d.mts.map} +1 -1
  24. package/dist/index-TMfRNrCg.d.mts.map +1 -1
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.d.cts +1 -1
  27. package/dist/index.d.mts +1 -1
  28. package/dist/index.mjs +1 -1
  29. package/dist/next.cjs +2 -2
  30. package/dist/next.mjs +2 -2
  31. package/dist/nuxt.cjs +3 -3
  32. package/dist/nuxt.d.mts +1 -1
  33. package/dist/nuxt.mjs +3 -3
  34. package/dist/{plugin-CPi1BC54.d.cts → plugin-C4Et_TED.d.cts} +2 -2
  35. package/dist/{plugin-CPi1BC54.d.cts.map → plugin-C4Et_TED.d.cts.map} +1 -1
  36. package/dist/plugin-utils.d.cts +2 -2
  37. package/dist/plugin-utils.d.cts.map +1 -1
  38. package/dist/plugin-utils.d.mts +3 -3
  39. package/dist/plugin-utils.d.mts.map +1 -1
  40. package/dist/{rolldown-HYYWYM2Y.mjs → rolldown-B9d-UBOh.mjs} +2 -2
  41. package/dist/{rolldown-HYYWYM2Y.mjs.map → rolldown-B9d-UBOh.mjs.map} +1 -1
  42. package/dist/{rolldown-1g-LKcc6.cjs → rolldown-BEruRGiG.cjs} +1 -1
  43. package/dist/rolldown.cjs +2 -2
  44. package/dist/rolldown.d.mts +1 -1
  45. package/dist/rolldown.mjs +2 -2
  46. package/dist/rollup.cjs +1 -1
  47. package/dist/rollup.d.mts +1 -1
  48. package/dist/rollup.mjs +1 -1
  49. package/dist/rspack.cjs +1 -1
  50. package/dist/rspack.d.mts +1 -1
  51. package/dist/rspack.mjs +1 -1
  52. package/dist/storage/index.d.mts +1 -1
  53. package/dist/tsdown.cjs +2 -2
  54. package/dist/tsdown.d.mts +1 -1
  55. package/dist/tsdown.mjs +2 -2
  56. package/dist/tsup.cjs +2 -2
  57. package/dist/tsup.d.mts +1 -1
  58. package/dist/tsup.mjs +2 -2
  59. package/dist/typescript/index.d.mts +1 -1
  60. package/dist/unloader.cjs +1 -1
  61. package/dist/unloader.d.mts +1 -1
  62. package/dist/unloader.mjs +1 -1
  63. package/dist/unplugin.cjs +1 -1
  64. package/dist/unplugin.d.cts +1 -1
  65. package/dist/unplugin.d.mts +1 -1
  66. package/dist/unplugin.mjs +1 -1
  67. package/dist/{vite-C6OXShid.cjs → vite-BF6-Ngk0.cjs} +1 -1
  68. package/dist/{vite-BKmkglFo.mjs → vite-DOMQMT51.mjs} +2 -2
  69. package/dist/{vite-BKmkglFo.mjs.map → vite-DOMQMT51.mjs.map} +1 -1
  70. package/dist/vite.cjs +2 -2
  71. package/dist/vite.d.mts +1 -1
  72. package/dist/vite.mjs +2 -2
  73. package/dist/{webpack-DZvno7jS.mjs → webpack-Bm8A2hrJ.mjs} +2 -2
  74. package/dist/{webpack-DZvno7jS.mjs.map → webpack-Bm8A2hrJ.mjs.map} +1 -1
  75. package/dist/{webpack-L3DT059U.cjs → webpack-u38abx-b.cjs} +1 -1
  76. package/dist/webpack.cjs +2 -2
  77. package/dist/webpack.d.mts +1 -1
  78. package/dist/webpack.mjs +2 -2
  79. package/package.json +28 -28
  80. package/dist/api-D1TJOJXE.mjs.map +0 -1
package/dist/rollup.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import * as rollup0 from "rollup";
6
6
  import { RollupOptions } from "rollup";
7
7
 
package/dist/rollup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
package/dist/rspack.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-CMgoAQum.cjs');
3
+ const require_api = require('./api-DtumO6qc.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
package/dist/rspack.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import * as unplugin0 from "unplugin";
6
6
  import { Configuration } from "@rspack/core";
7
7
 
package/dist/rspack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -1,7 +1,7 @@
1
1
  import { Ir as StorageAdapter, Rr as StoragePreset, _t as Context } from "../config-B76VxuFj.mjs";
2
2
  import "../config-BYUOZn2-.mjs";
3
3
  import "../index-TMfRNrCg.mjs";
4
- import "../index-Dqk6Rh9U.mjs";
4
+ import "../index-BbFz3REx.mjs";
5
5
  import "../types-Bh_vLuQ0.mjs";
6
6
  import { writeFile, writeFileSync } from "@stryke/fs/write-file";
7
7
  import { MaybePromise } from "@stryke/types/base";
package/dist/tsdown.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-CMgoAQum.cjs');
3
+ const require_api = require('./api-DtumO6qc.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  const require_plugin_utils = require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
@@ -11,7 +11,7 @@ require('./virtual-D8bn8LRN.cjs');
11
11
  require('./utils-CxKWmhs2.cjs');
12
12
  require('./resolve-options-vyFhhkLp.cjs');
13
13
  require('./resolve-options-lxQ2pm0W.cjs');
14
- const require_rolldown = require('./rolldown-1g-LKcc6.cjs');
14
+ const require_rolldown = require('./rolldown-BEruRGiG.cjs');
15
15
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
16
16
  let __stryke_path_append = require("@stryke/path/append");
17
17
  let __stryke_path_join_paths = require("@stryke/path/join-paths");
package/dist/tsdown.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import { UserConfig } from "tsdown";
6
6
  import { Format } from "@storm-software/build-tools/types";
7
7
  import { UserConfig as UserConfig$1 } from "tsdown/config";
package/dist/tsdown.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import { r as formatPackageJson, w as getDependencyConfig } from "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -9,7 +9,7 @@ import "./virtual-D-9vfvVY.mjs";
9
9
  import "./utils-RU0EjpzP.mjs";
10
10
  import "./resolve-options-6sXFqzEA.mjs";
11
11
  import "./resolve-options-D-RGs8j8.mjs";
12
- import { t as rolldown_default } from "./rolldown-HYYWYM2Y.mjs";
12
+ import { t as rolldown_default } from "./rolldown-B9d-UBOh.mjs";
13
13
  import { toArray } from "@stryke/convert/to-array";
14
14
  import { appendPath } from "@stryke/path/append";
15
15
  import { joinPaths } from "@stryke/path/join-paths";
package/dist/tsup.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-CMgoAQum.cjs');
3
+ const require_api = require('./api-DtumO6qc.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
@@ -10,7 +10,7 @@ require('./config-D86Vw7SC.cjs');
10
10
  require('./virtual-D8bn8LRN.cjs');
11
11
  require('./utils-CxKWmhs2.cjs');
12
12
  const require_resolve_options = require('./resolve-options-B1gzDFxb.cjs');
13
- const require_esbuild = require('./esbuild-B8xqzmmF.cjs');
13
+ const require_esbuild = require('./esbuild-BVasizva.cjs');
14
14
  let __stryke_convert_to_array = require("@stryke/convert/to-array");
15
15
  let __stryke_helpers_omit = require("@stryke/helpers/omit");
16
16
  let __stryke_path_append = require("@stryke/path/append");
package/dist/tsup.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Et as PluginContext, Zn as Plugin, j as ResolvedConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import { resolveOptions } from "@storm-software/tsup";
6
6
  import { Options } from "tsup";
7
7
  import { BuildOptions as BuildOptions$1 } from "@storm-software/tsup/types";
package/dist/tsup.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -8,7 +8,7 @@ import "./config-D4Fh2gQL.mjs";
8
8
  import "./virtual-D-9vfvVY.mjs";
9
9
  import "./utils-RU0EjpzP.mjs";
10
10
  import { n as resolveEntry } from "./resolve-options-Ym_q-Hb7.mjs";
11
- import { t as esbuild_default } from "./esbuild-Bo7TrGmt.mjs";
11
+ import { t as esbuild_default } from "./esbuild-ChH1x8Hc.mjs";
12
12
  import { toArray } from "@stryke/convert/to-array";
13
13
  import { omit } from "@stryke/helpers/omit";
14
14
  import { appendPath } from "@stryke/path/append";
@@ -1,7 +1,7 @@
1
1
  import { _t as Context, dn as TSConfig, on as ParsedTypeScriptConfig } from "../config-B76VxuFj.mjs";
2
2
  import "../config-BYUOZn2-.mjs";
3
3
  import "../index-TMfRNrCg.mjs";
4
- import "../index-Dqk6Rh9U.mjs";
4
+ import "../index-BbFz3REx.mjs";
5
5
  import { FileSystemHost, InMemoryFileSystemHost, Project, ProjectOptions, RuntimeDirEntry } from "ts-morph";
6
6
  import ts from "typescript";
7
7
  import { FilterPattern } from "@stryke/types/file";
package/dist/unloader.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_chunk = require('./chunk-CbDLau6x.cjs');
3
- const require_api = require('./api-CMgoAQum.cjs');
3
+ const require_api = require('./api-DtumO6qc.cjs');
4
4
  require('./tsconfig-C8M8X6U0.cjs');
5
5
  require('./plugin-utils-Ck3cx3w6.cjs');
6
6
  require('./plugin-CZ_PJPpQ.cjs');
@@ -1,7 +1,7 @@
1
1
  import { N as UserConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import * as unloader0 from "unloader";
6
6
 
7
7
  //#region src/unloader.d.ts
package/dist/unloader.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
package/dist/unplugin.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_api = require('./api-CMgoAQum.cjs');
1
+ const require_api = require('./api-DtumO6qc.cjs');
2
2
  require('./tsconfig-C8M8X6U0.cjs');
3
3
  require('./plugin-utils-Ck3cx3w6.cjs');
4
4
  require('./plugin-CZ_PJPpQ.cjs');
@@ -1,5 +1,5 @@
1
1
  import { _t as Context, br as UnpluginOptions$1, kr as API, vr as UnpluginBuilderVariant, yr as UnpluginFactory } from "./config-CY-rNoQX.cjs";
2
- import { a as createUnplugin, c as __ΩCreateUnpluginModuleResolutionFunctionsOptions, d as isUnpluginBuilderVariant, i as __ΩCreateUnpluginResolverOptions, l as createUnpluginModuleResolutionFunctions, n as CreateUnpluginResolverOptions, o as createUnpluginResolver, r as __ΩCreateUnpluginOptions, s as CreateUnpluginModuleResolutionFunctionsOptions, t as CreateUnpluginOptions, u as combineContexts } from "./plugin-CPi1BC54.cjs";
2
+ import { a as createUnplugin, c as __ΩCreateUnpluginModuleResolutionFunctionsOptions, d as isUnpluginBuilderVariant, i as __ΩCreateUnpluginResolverOptions, l as createUnpluginModuleResolutionFunctions, n as CreateUnpluginResolverOptions, o as createUnpluginResolver, r as __ΩCreateUnpluginOptions, s as CreateUnpluginModuleResolutionFunctionsOptions, t as CreateUnpluginOptions, u as combineContexts } from "./plugin-C4Et_TED.cjs";
3
3
  import { UnpluginOptions } from "unplugin";
4
4
 
5
5
  //#region src/unplugin.d.ts
@@ -1,7 +1,7 @@
1
1
  import { _t as Context, br as UnpluginOptions$1, kr as API, vr as UnpluginBuilderVariant, yr as UnpluginFactory } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import { a as createUnplugin, c as __ΩCreateUnpluginModuleResolutionFunctionsOptions, d as isUnpluginBuilderVariant, i as __ΩCreateUnpluginResolverOptions, l as createUnpluginModuleResolutionFunctions, n as CreateUnpluginResolverOptions, o as createUnpluginResolver, r as __ΩCreateUnpluginOptions, s as CreateUnpluginModuleResolutionFunctionsOptions, t as CreateUnpluginOptions, u as combineContexts } from "./index-Dqk6Rh9U.mjs";
4
+ import { a as createUnplugin, c as __ΩCreateUnpluginModuleResolutionFunctionsOptions, d as isUnpluginBuilderVariant, i as __ΩCreateUnpluginResolverOptions, l as createUnpluginModuleResolutionFunctions, n as CreateUnpluginResolverOptions, o as createUnpluginResolver, r as __ΩCreateUnpluginOptions, s as CreateUnpluginModuleResolutionFunctionsOptions, t as CreateUnpluginOptions, u as combineContexts } from "./index-BbFz3REx.mjs";
5
5
  import { UnpluginOptions } from "unplugin";
6
6
 
7
7
  //#region src/unplugin.d.ts
package/dist/unplugin.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, c as createUnpluginModuleResolutionFunctions, l as combineContexts, o as createUnplugin, s as createUnpluginResolver, u as isUnpluginBuilderVariant } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory, c as createUnpluginModuleResolutionFunctions, l as combineContexts, o as createUnplugin, s as createUnpluginResolver, u as isUnpluginBuilderVariant } from "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_api = require('./api-CMgoAQum.cjs');
2
+ const require_api = require('./api-DtumO6qc.cjs');
3
3
  const require_resolve_options = require('./resolve-options-B1gzDFxb.cjs');
4
4
  const require_resolve_options$1 = require('./resolve-options-vyFhhkLp.cjs');
5
5
  const require_resolve_options$2 = require('./resolve-options-lxQ2pm0W.cjs');
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import { r as resolveOptions$1 } from "./resolve-options-Ym_q-Hb7.mjs";
3
3
  import { n as resolveOptions$3 } from "./resolve-options-6sXFqzEA.mjs";
4
4
  import { t as resolveOptions$2 } from "./resolve-options-D-RGs8j8.mjs";
@@ -168,4 +168,4 @@ var vite_default = unplugin;
168
168
 
169
169
  //#endregion
170
170
  export { vite_default as n, src_default as r, unplugin as t };
171
- //# sourceMappingURL=vite-BKmkglFo.mjs.map
171
+ //# sourceMappingURL=vite-DOMQMT51.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-BKmkglFo.mjs","names":["DEFAULT_VITE_CONFIG: Partial<ViteOptions>","resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions","createVitePlugin","createViteUnplugin","createVitePlugin","plugin"],"sources":["../../plugin-vite/src/helpers/resolve-options.ts","../../plugin-vite/src/helpers/unplugin.ts","../../plugin-vite/src/index.ts","../src/vite.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 { resolveOptions as resolveEsbuildOptions } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { resolveOptions as resolveRolldownOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { VitePluginResolvedConfig } from \"../types\";\nimport { ViteOptions } from \"../types/build\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteOptions> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ViteOptions {\n return defu(\n {\n resolve: {\n alias: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n ),\n dedupe: context.config.resolve.dedupe,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n extensions: context.config.resolve.extensions\n }\n },\n (context.config as VitePluginResolvedConfig).vite\n ? defu(\n (context.config as VitePluginResolvedConfig).vite,\n {\n optimizeDeps:\n (context.config as VitePluginResolvedConfig).vite?.optimizeDeps ??\n {}\n },\n {\n optimizeDeps: {\n extensions: context.config.resolve.extensions\n }\n }\n )\n : {},\n {\n define: context.config.define,\n rootDir: context.fs.existsSync(joinPaths(context.config.root, \"src\"))\n ? joinPaths(context.config.root, \"src\")\n : context.config.root,\n platform: context.config.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n outDir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: resolveEsbuildOptions(context) as ESBuildOptions,\n optimizeDeps: {\n rolldownOptions: resolveRolldownOptions(context),\n rollupOptions: resolveRollupOptions(context),\n esbuildOptions: resolveEsbuildOptions(context)\n },\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n ) as ViteOptions;\n}\n","/* -------------------------------------------------------------------\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 { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(createUnplugin(context))({});\n}\n","/* -------------------------------------------------------------------\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, Plugin } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport { build, InlineConfig } from \"vite\";\nimport { DEFAULT_VITE_CONFIG, resolveOptions } from \"./helpers/resolve-options\";\nimport { createVitePlugin } from \"./helpers/unplugin\";\nimport { UNSAFE_VitePluginContext } from \"./types/_internal\";\nimport {\n VitePluginContext,\n VitePluginOptions,\n VitePluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n vite?: VitePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <TContext extends VitePluginContext = VitePluginContext>(\n options: VitePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"vite\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `vite` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n vite: {\n ...DEFAULT_VITE_CONFIG,\n ...options\n },\n singleBuild: true\n } as Partial<VitePluginResolvedConfig>;\n },\n async build() {\n this.trace(`Building the Powerlines plugin.`);\n\n const environments = (this as unknown as UNSAFE_VitePluginContext)\n ?.$$internal?.api?.context?.environments;\n if (!environments || Object.keys(environments).length === 0) {\n throw new Error(\n `No environments found in the Powerlines context. At least one environment should have been generated - please report this issue to https://github.com/storm-software/powerlines/issues.`\n );\n }\n\n this.trace(\n `Running Vite for ${Object.keys(environments).length} environments.`\n );\n\n const config = defu(\n {\n config: false,\n entry: this.entry,\n environments: Object.fromEntries(\n Object.entries(environments).map(([name, env]) => [\n name,\n resolveOptions(env as Context)\n ])\n )\n },\n resolveOptions(this),\n {\n plugins: [createVitePlugin(this)]\n }\n );\n\n await build(config as InlineConfig);\n }\n };\n};\n\nexport default plugin;\n","/* -------------------------------------------------------------------\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 { resolveOptions } from \"@powerlines/plugin-vite/helpers/resolve-options\";\nimport {\n ViteOptions,\n VitePluginUserConfig\n} from \"@powerlines/plugin-vite/types\";\nimport { isDevelopmentMode, isTestMode } from \"@stryke/env/environment-checks\";\nimport defu from \"defu\";\nimport { createVitePlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport { default as plugin, default as vite } from \"@powerlines/plugin-vite\";\n\n/**\n * A Vite plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://vitejs.dev/guide/api-plugin.html#plugin-api\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import powerlines from \"powerlines/vite\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nexport const unplugin = createVitePlugin<Partial<VitePluginUserConfig>>(\n createUnpluginFactory(\"vite\", (api, plugin) => {\n return {\n ...plugin,\n vite: {\n sharedDuringBuild: true,\n\n async hotUpdate(options) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:hotUpdate\", { environment }, options);\n },\n async config(config, env) {\n api.context.config.mode = isDevelopmentMode(env.mode)\n ? \"development\"\n : isTestMode(env.mode)\n ? \"test\"\n : \"production\";\n\n const environment = await api.context.getEnvironment();\n const result = await api.callHook(\n \"vite:config\",\n { environment },\n config,\n env\n );\n\n return defu(\n resolveOptions(api.context),\n // Need to use `any` here to avoid excessive type complexity\n result?.build ?? {},\n config\n ) as Omit<ViteOptions, \"plugins\">;\n },\n async configResolved(_config) {\n const environment = await api.context.getEnvironment();\n\n await api.callHook(\"configResolved\", { environment });\n },\n async configureServer(server) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:configureServer\", { environment }, server);\n },\n async configurePreviewServer(server) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\n \"vite:configurePreviewServer\",\n { environment },\n server\n );\n },\n async transformIndexHtml(html, ctx) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\n \"vite:transformIndexHtml\",\n { environment },\n html,\n ctx\n );\n },\n async handleHotUpdate(ctx) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:handleHotUpdate\", { environment }, ctx);\n }\n }\n };\n })\n);\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;AA4BA,MAAaA,sBAA4C;CACvD,SAAS,EACP,YAAY;EAA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kBAAkB,EAAE,aAAa,EAAE,QAAQ;;GAEjE,MAAM,OAAO,QAAQ,KAAK;AACxB,QAAI,QAAQ,OAAO,OAAO,kBAAkB,IAAI,KAAK,GACjD,gBACA,WAAW,IAAI,KAAK,GAClB,SACA;IAEN,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;IACtD,MAAM,SAAS,MAAM,IAAI,SACvB,eACA,EAAE,aAAa,EACf,QACA,IACD;AAED,WAAO,KACL,eAAe,IAAI,QAAQ,EAE3B,QAAQ,SAAS,EAAE,EACnB,OACD;;GAEH,MAAM,eAAe,SAAS;IAC5B,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,UAAM,IAAI,SAAS,kBAAkB,EAAE,aAAa,CAAC;;GAEvD,MAAM,gBAAgB,QAAQ;IAC5B,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SAAS,wBAAwB,EAAE,aAAa,EAAE,OAAO;;GAEtE,MAAM,uBAAuB,QAAQ;IACnC,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SACT,+BACA,EAAE,aAAa,EACf,OACD;;GAEH,MAAM,mBAAmB,MAAM,KAAK;IAClC,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SACT,2BACA,EAAE,aAAa,EACf,MACA,IACD;;GAEH,MAAM,gBAAgB,KAAK;IACzB,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SAAS,wBAAwB,EAAE,aAAa,EAAE,IAAI;;GAEpE;EACF;EACD,CACH;AAED,mBAAe"}
1
+ {"version":3,"file":"vite-DOMQMT51.mjs","names":["DEFAULT_VITE_CONFIG: Partial<ViteOptions>","resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions","createVitePlugin","createViteUnplugin","createVitePlugin","plugin"],"sources":["../../plugin-vite/src/helpers/resolve-options.ts","../../plugin-vite/src/helpers/unplugin.ts","../../plugin-vite/src/index.ts","../src/vite.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 { resolveOptions as resolveEsbuildOptions } from \"@powerlines/plugin-esbuild/helpers/resolve-options\";\nimport { resolveOptions as resolveRolldownOptions } from \"@powerlines/plugin-rolldown/helpers/resolve-options\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { ESBuildOptions } from \"vite\";\nimport { VitePluginResolvedConfig } from \"../types\";\nimport { ViteOptions } from \"../types/build\";\n\nexport const DEFAULT_VITE_CONFIG: Partial<ViteOptions> = {\n resolve: {\n extensions: [\".mjs\", \".js\", \".mts\", \".ts\", \".jsx\", \".tsx\", \".json\"]\n },\n json: {\n stringify: true\n },\n logLevel: \"silent\",\n clearScreen: true\n};\n\n/**\n * Resolves the options for [vite](https://vitejs.dev/).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): ViteOptions {\n return defu(\n {\n resolve: {\n alias: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n ),\n dedupe: context.config.resolve.dedupe,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n extensions: context.config.resolve.extensions\n }\n },\n (context.config as VitePluginResolvedConfig).vite\n ? defu(\n (context.config as VitePluginResolvedConfig).vite,\n {\n optimizeDeps:\n (context.config as VitePluginResolvedConfig).vite?.optimizeDeps ??\n {}\n },\n {\n optimizeDeps: {\n extensions: context.config.resolve.extensions\n }\n }\n )\n : {},\n {\n define: context.config.define,\n rootDir: context.fs.existsSync(joinPaths(context.config.root, \"src\"))\n ? joinPaths(context.config.root, \"src\")\n : context.config.root,\n platform: context.config.platform,\n mode:\n context.config.mode === \"development\" ? \"development\" : \"production\",\n cacheDir: joinPaths(context.cachePath, \"vite\"),\n build: {\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\",\n outDir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n tsconfigRaw: context.tsconfig.tsconfigJson\n },\n esbuild: resolveEsbuildOptions(context) as ESBuildOptions,\n optimizeDeps: {\n rolldownOptions: resolveRolldownOptions(context),\n rollupOptions: resolveRollupOptions(context),\n esbuildOptions: resolveEsbuildOptions(context)\n },\n logLevel: context.config.logLevel ?? undefined,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n ) as ViteOptions;\n}\n","/* -------------------------------------------------------------------\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 { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(createUnplugin(context))({});\n}\n","/* -------------------------------------------------------------------\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, Plugin } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport { build, InlineConfig } from \"vite\";\nimport { DEFAULT_VITE_CONFIG, resolveOptions } from \"./helpers/resolve-options\";\nimport { createVitePlugin } from \"./helpers/unplugin\";\nimport { UNSAFE_VitePluginContext } from \"./types/_internal\";\nimport {\n VitePluginContext,\n VitePluginOptions,\n VitePluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n vite?: VitePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <TContext extends VitePluginContext = VitePluginContext>(\n options: VitePluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"vite\",\n config() {\n this.trace(\n \"Providing default configuration for the Powerlines `vite` build plugin.\"\n );\n\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n vite: {\n ...DEFAULT_VITE_CONFIG,\n ...options\n },\n singleBuild: true\n } as Partial<VitePluginResolvedConfig>;\n },\n async build() {\n this.trace(`Building the Powerlines plugin.`);\n\n const environments = (this as unknown as UNSAFE_VitePluginContext)\n ?.$$internal?.api?.context?.environments;\n if (!environments || Object.keys(environments).length === 0) {\n throw new Error(\n `No environments found in the Powerlines context. At least one environment should have been generated - please report this issue to https://github.com/storm-software/powerlines/issues.`\n );\n }\n\n this.trace(\n `Running Vite for ${Object.keys(environments).length} environments.`\n );\n\n const config = defu(\n {\n config: false,\n entry: this.entry,\n environments: Object.fromEntries(\n Object.entries(environments).map(([name, env]) => [\n name,\n resolveOptions(env as Context)\n ])\n )\n },\n resolveOptions(this),\n {\n plugins: [createVitePlugin(this)]\n }\n );\n\n await build(config as InlineConfig);\n }\n };\n};\n\nexport default plugin;\n","/* -------------------------------------------------------------------\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 { resolveOptions } from \"@powerlines/plugin-vite/helpers/resolve-options\";\nimport {\n ViteOptions,\n VitePluginUserConfig\n} from \"@powerlines/plugin-vite/types\";\nimport { isDevelopmentMode, isTestMode } from \"@stryke/env/environment-checks\";\nimport defu from \"defu\";\nimport { createVitePlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport { default as plugin, default as vite } from \"@powerlines/plugin-vite\";\n\n/**\n * A Vite plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://vitejs.dev/guide/api-plugin.html#plugin-api\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import powerlines from \"powerlines/vite\";\n *\n * export default defineConfig({\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * });\n *\n * ```\n */\nexport const unplugin = createVitePlugin<Partial<VitePluginUserConfig>>(\n createUnpluginFactory(\"vite\", (api, plugin) => {\n return {\n ...plugin,\n vite: {\n sharedDuringBuild: true,\n\n async hotUpdate(options) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:hotUpdate\", { environment }, options);\n },\n async config(config, env) {\n api.context.config.mode = isDevelopmentMode(env.mode)\n ? \"development\"\n : isTestMode(env.mode)\n ? \"test\"\n : \"production\";\n\n const environment = await api.context.getEnvironment();\n const result = await api.callHook(\n \"vite:config\",\n { environment },\n config,\n env\n );\n\n return defu(\n resolveOptions(api.context),\n // Need to use `any` here to avoid excessive type complexity\n result?.build ?? {},\n config\n ) as Omit<ViteOptions, \"plugins\">;\n },\n async configResolved(_config) {\n const environment = await api.context.getEnvironment();\n\n await api.callHook(\"configResolved\", { environment });\n },\n async configureServer(server) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:configureServer\", { environment }, server);\n },\n async configurePreviewServer(server) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\n \"vite:configurePreviewServer\",\n { environment },\n server\n );\n },\n async transformIndexHtml(html, ctx) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\n \"vite:transformIndexHtml\",\n { environment },\n html,\n ctx\n );\n },\n async handleHotUpdate(ctx) {\n const environment = await api.context.getEnvironment();\n\n return api.callHook(\"vite:handleHotUpdate\", { environment }, ctx);\n }\n }\n };\n })\n);\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\n"],"mappings":";;;;;;;;;;;AA4BA,MAAaA,sBAA4C;CACvD,SAAS,EACP,YAAY;EAAC;EAAQ;EAAO;EAAQ;EAAO;EAAQ;EAAQ;EAAQ,EACpE;CACD,MAAM,EACJ,WAAW,MACZ;CACD,UAAU;CACV,aAAa;CACd;;;;;;;AAQD,SAAgB,eAAe,SAA+B;AAC5D,QAAO,KACL,EACE,SAAS;EACP,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC,QAClC,KAAK,CAAC,IAAI,UAAU;AACnB,OAAI,CAAC,IAAI,MAAK,MAAK,EAAE,SAAS,GAAG,CAC/B,KAAI,KAAK;IACP,MAAM;IACN,aAAa;IACd,CAAC;OAEF,SAAQ,KACN,8BAA8B,GAAG,2CAClC;AAGH,UAAO;KAET,EA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AgB;AAEtD,UAAM,IAAI,SAAS,kBAAkB,EAAE,aAAa,CAAC;;GAEvD,MAAM,gBAAgB,QAAQ;IAC5B,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SAAS,wBAAwB,EAAE,aAAa,EAAE,OAAO;;GAEtE,MAAM,uBAAuB,QAAQ;IACnC,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SACT,+BACA,EAAE,aAAa,EACf,OACD;;GAEH,MAAM,mBAAmB,MAAM,KAAK;IAClC,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SACT,2BACA,EAAE,aAAa,EACf,MACA,IACD;;GAEH,MAAM,gBAAgB,KAAK;IACzB,MAAM,cAAc,MAAM,IAAI,QAAQ,gBAAgB;AAEtD,WAAO,IAAI,SAAS,wBAAwB,EAAE,aAAa,EAAE,IAAI;;GAEpE;EACF;EACD,CACH;AAED,mBAAe"}
package/dist/vite.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./api-CMgoAQum.cjs');
2
+ require('./api-DtumO6qc.cjs');
3
3
  require('./tsconfig-C8M8X6U0.cjs');
4
4
  require('./plugin-utils-Ck3cx3w6.cjs');
5
5
  require('./plugin-CZ_PJPpQ.cjs');
@@ -11,7 +11,7 @@ require('./utils-CxKWmhs2.cjs');
11
11
  require('./resolve-options-B1gzDFxb.cjs');
12
12
  require('./resolve-options-vyFhhkLp.cjs');
13
13
  require('./resolve-options-lxQ2pm0W.cjs');
14
- const require_vite = require('./vite-C6OXShid.cjs');
14
+ const require_vite = require('./vite-BF6-Ngk0.cjs');
15
15
 
16
16
  exports.default = require_vite.vite_default;
17
17
  exports["module.exports"] = require_vite.unplugin;
package/dist/vite.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Zn as Plugin } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import { n as VitePluginOptions, r as VitePluginUserConfig, t as VitePluginContext } from "./plugin-DE7BXFkV.mjs";
6
6
  import * as vite0 from "vite";
7
7
 
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./api-D1TJOJXE.mjs";
1
+ import "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -10,6 +10,6 @@ import "./utils-RU0EjpzP.mjs";
10
10
  import "./resolve-options-Ym_q-Hb7.mjs";
11
11
  import "./resolve-options-6sXFqzEA.mjs";
12
12
  import "./resolve-options-D-RGs8j8.mjs";
13
- import { n as vite_default, r as src_default, t as unplugin } from "./vite-BKmkglFo.mjs";
13
+ import { n as vite_default, r as src_default, t as unplugin } from "./vite-DOMQMT51.mjs";
14
14
 
15
15
  export { vite_default as default, unplugin as "module.exports", unplugin, src_default as plugin, src_default as vite };
@@ -1,4 +1,4 @@
1
- import { a as createUnpluginFactory, o as createUnplugin } from "./api-D1TJOJXE.mjs";
1
+ import { a as createUnpluginFactory, o as createUnplugin } from "./api-CHXfSSj6.mjs";
2
2
  import { joinPaths } from "@stryke/path/join-paths";
3
3
  import defu from "defu";
4
4
  import { createWebpackPlugin } from "unplugin";
@@ -85,4 +85,4 @@ var webpack_default = unplugin;
85
85
 
86
86
  //#endregion
87
87
  export { webpack_default as n, src_default as r, unplugin as t };
88
- //# sourceMappingURL=webpack-DZvno7jS.mjs.map
88
+ //# sourceMappingURL=webpack-Bm8A2hrJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-DZvno7jS.mjs","names":["createWebpackPlugin","createWebpackUnplugin","createWebpackPlugin"],"sources":["../../plugin-webpack/src/helpers/resolve-options.ts","../../plugin-webpack/src/helpers/unplugin.ts","../../plugin-webpack/src/index.ts","../src/webpack.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.buildPath\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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 BaseConfig {\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","/* -------------------------------------------------------------------\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 { WebpackPluginUserConfig } from \"@powerlines/plugin-webpack/types/plugin\";\nimport { createWebpackPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as webpack\n} from \"@powerlines/plugin-webpack\";\n\n/**\n * An Webpack plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://webpack.js.org/contribute/writing-a-plugin/#basic-plugin-architecture\n *\n * @example\n * ```js\n * // webpack.config.js\n * import powerlines from \"powerlines/webpack\";\n *\n * export default {\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * }\n * ```\n */\nexport const unplugin = createWebpackPlugin<Partial<WebpackPluginUserConfig>>(\n createUnpluginFactory(\"webpack\")\n);\n\nexport default unplugin;\n\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S,CAACC,sBAAoB,KAAK,CAAC,EACrC,CACF,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;ACxCf,MAAa,WAAW,oBACtB,sBAAsB,UAAU,CACjC;AAED,sBAAe"}
1
+ {"version":3,"file":"webpack-Bm8A2hrJ.mjs","names":["createWebpackPlugin","createWebpackUnplugin","createWebpackPlugin"],"sources":["../../plugin-webpack/src/helpers/resolve-options.ts","../../plugin-webpack/src/helpers/unplugin.ts","../../plugin-webpack/src/index.ts","../src/webpack.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.buildPath\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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 BaseConfig {\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","/* -------------------------------------------------------------------\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 { WebpackPluginUserConfig } from \"@powerlines/plugin-webpack/types/plugin\";\nimport { createWebpackPlugin } from \"unplugin\";\nimport { createUnpluginFactory } from \"./unplugin\";\n\nexport {\n default as plugin,\n default as webpack\n} from \"@powerlines/plugin-webpack\";\n\n/**\n * An Webpack plugin that will invoke the Powerlines API hooks during the build process.\n *\n * @see https://webpack.js.org/contribute/writing-a-plugin/#basic-plugin-architecture\n *\n * @example\n * ```js\n * // webpack.config.js\n * import powerlines from \"powerlines/webpack\";\n *\n * export default {\n * plugins: [powerlines({ name: \"example-app\", ... })],\n * }\n * ```\n */\nexport const unplugin = createWebpackPlugin<Partial<WebpackPluginUserConfig>>(\n createUnpluginFactory(\"webpack\")\n);\n\nexport default unplugin;\n\nexport { unplugin as \"module.exports\" };\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,UACvB,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;;;;;AClEH,SAAgBA,sBAAoB,SAA+B;AACjE,QAAOC,oBAAsB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC;;;;;;;;ACkB3D,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,CAACC,sBAAoB,KAAK,CAAC,EACrC,CACF,CACF;;EAEJ;;AAGH,kBAAe;;;;;;;;;;;;;;;;;;;ACxCf,MAAa,WAAW,oBACtB,sBAAsB,UAAU,CACjC;AAED,sBAAe"}
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_api = require('./api-CMgoAQum.cjs');
2
+ const require_api = require('./api-DtumO6qc.cjs');
3
3
  let __stryke_path_join_paths = require("@stryke/path/join-paths");
4
4
  let defu = require("defu");
5
5
  defu = require_chunk.__toESM(defu);
package/dist/webpack.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- require('./api-CMgoAQum.cjs');
2
+ require('./api-DtumO6qc.cjs');
3
3
  require('./tsconfig-C8M8X6U0.cjs');
4
4
  require('./plugin-utils-Ck3cx3w6.cjs');
5
5
  require('./plugin-CZ_PJPpQ.cjs');
@@ -8,7 +8,7 @@ require('./constants-CZh5rsgh.cjs');
8
8
  require('./config-D86Vw7SC.cjs');
9
9
  require('./virtual-D8bn8LRN.cjs');
10
10
  require('./utils-CxKWmhs2.cjs');
11
- const require_webpack = require('./webpack-L3DT059U.cjs');
11
+ const require_webpack = require('./webpack-u38abx-b.cjs');
12
12
 
13
13
  exports.default = require_webpack.webpack_default;
14
14
  exports["module.exports"] = require_webpack.unplugin;
@@ -1,7 +1,7 @@
1
1
  import { Et as PluginContext, N as UserConfig, Zn as Plugin, j as ResolvedConfig } from "./config-B76VxuFj.mjs";
2
2
  import "./config-BYUOZn2-.mjs";
3
3
  import "./index-TMfRNrCg.mjs";
4
- import "./index-Dqk6Rh9U.mjs";
4
+ import "./index-BbFz3REx.mjs";
5
5
  import * as webpack0 from "webpack";
6
6
  import { Configuration } from "webpack";
7
7
 
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./api-D1TJOJXE.mjs";
1
+ import "./api-CHXfSSj6.mjs";
2
2
  import "./tsconfig-B92heKit.mjs";
3
3
  import "./plugin-utils-C3HnZJl1.mjs";
4
4
  import "./plugin-E5foRD0k.mjs";
@@ -7,6 +7,6 @@ import "./constants-cXxSHhNp.mjs";
7
7
  import "./config-D4Fh2gQL.mjs";
8
8
  import "./virtual-D-9vfvVY.mjs";
9
9
  import "./utils-RU0EjpzP.mjs";
10
- import { n as webpack_default, r as src_default, t as unplugin } from "./webpack-DZvno7jS.mjs";
10
+ import { n as webpack_default, r as src_default, t as unplugin } from "./webpack-Bm8A2hrJ.mjs";
11
11
 
12
12
  export { webpack_default as default, unplugin as "module.exports", unplugin, src_default as plugin, src_default as webpack };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerlines",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "private": false,
5
5
  "description": "The \"any framework\" framework that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.",
6
6
  "keywords": [
@@ -341,21 +341,21 @@
341
341
  "dependencies": {
342
342
  "@cacheable/memory": "^2.0.8",
343
343
  "@donedeal0/superdiff": "^3.2.0",
344
- "@powerlines/core": "^0.1.9",
345
- "@storm-software/config": "^1.135.14",
346
- "@storm-software/config-tools": "^1.189.13",
344
+ "@powerlines/core": "^0.1.10",
345
+ "@storm-software/config": "^1.135.18",
346
+ "@storm-software/config-tools": "^1.189.17",
347
347
  "@stryke/capnp": "^0.12.75",
348
- "@stryke/convert": "^0.6.46",
349
- "@stryke/env": "^0.20.67",
350
- "@stryke/fs": "^0.33.50",
351
- "@stryke/hash": "^0.13.3",
352
- "@stryke/helpers": "^0.9.48",
353
- "@stryke/http": "^0.12.42",
354
- "@stryke/json": "^0.14.0",
355
- "@stryke/path": "^0.26.12",
348
+ "@stryke/convert": "^0.6.49",
349
+ "@stryke/env": "^0.20.70",
350
+ "@stryke/fs": "^0.33.53",
351
+ "@stryke/hash": "^0.13.6",
352
+ "@stryke/helpers": "^0.9.51",
353
+ "@stryke/http": "^0.12.45",
354
+ "@stryke/json": "^0.14.3",
355
+ "@stryke/path": "^0.26.15",
356
356
  "@stryke/string-format": "^0.14.8",
357
- "@stryke/type-checks": "^0.5.31",
358
- "@stryke/unique-id": "^0.3.61",
357
+ "@stryke/type-checks": "^0.5.34",
358
+ "@stryke/unique-id": "^0.3.64",
359
359
  "bundle-require": "^5.1.0",
360
360
  "compatx": "^0.2.0",
361
361
  "defu": "^6.1.4",
@@ -369,22 +369,22 @@
369
369
  "unplugin": "^3.0.0"
370
370
  },
371
371
  "devDependencies": {
372
- "@powerlines/plugin-esbuild": "^0.13.320",
373
- "@powerlines/plugin-rolldown": "^0.7.322",
374
- "@powerlines/plugin-rollup": "^0.7.321",
375
- "@powerlines/plugin-rspack": "^0.5.320",
376
- "@powerlines/plugin-tsdown": "^0.1.265",
377
- "@powerlines/plugin-tsup": "^0.12.321",
378
- "@powerlines/plugin-unbuild": "^0.5.321",
379
- "@powerlines/plugin-vite": "^0.14.314",
380
- "@powerlines/plugin-webpack": "^0.5.320",
381
- "@storm-software/testing-tools": "^1.119.88",
382
- "@stryke/types": "^0.10.45",
372
+ "@powerlines/plugin-esbuild": "^0.13.321",
373
+ "@powerlines/plugin-rolldown": "^0.7.323",
374
+ "@powerlines/plugin-rollup": "^0.7.322",
375
+ "@powerlines/plugin-rspack": "^0.5.321",
376
+ "@powerlines/plugin-tsdown": "^0.1.266",
377
+ "@powerlines/plugin-tsup": "^0.12.322",
378
+ "@powerlines/plugin-unbuild": "^0.5.322",
379
+ "@powerlines/plugin-vite": "^0.14.315",
380
+ "@powerlines/plugin-webpack": "^0.5.321",
381
+ "@storm-software/testing-tools": "^1.119.92",
382
+ "@stryke/types": "^0.10.48",
383
383
  "@types/bun": "^1.3.10",
384
- "@types/node": "^25.3.3",
384
+ "@types/node": "^25.3.5",
385
385
  "@types/semver": "^7.7.1",
386
386
  "bun-types-no-globals": "^1.3.10",
387
- "rolldown": "1.0.0-rc.6",
387
+ "rolldown": "1.0.0-rc.7",
388
388
  "tsdown": "^0.17.2",
389
389
  "typescript": "^5.9.3",
390
390
  "undici-types": "^7.22.0"
@@ -425,5 +425,5 @@
425
425
  "unloader": { "optional": true }
426
426
  },
427
427
  "publishConfig": { "access": "public" },
428
- "gitHead": "56410862ad299064942d87d6a36cc62acfb0b544"
428
+ "gitHead": "9d8c7149d35ca03f3ce533b404084b720eecf1a4"
429
429
  }