@powerlines/plugin-vite 0.14.458 → 0.14.462

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 (47) hide show
  1. package/dist/build-CksBpNAL.d.cts +13 -0
  2. package/dist/build-CksBpNAL.d.cts.map +1 -0
  3. package/dist/build-DST9kC_L.d.mts +13 -0
  4. package/dist/build-DST9kC_L.d.mts.map +1 -0
  5. package/dist/index.cjs +44 -17
  6. package/dist/index.d.cts +3 -5
  7. package/dist/index.d.cts.map +1 -1
  8. package/dist/index.d.mts +3 -5
  9. package/dist/index.d.mts.map +1 -1
  10. package/dist/index.mjs +16 -12
  11. package/dist/index.mjs.map +1 -1
  12. package/dist/types/build.d.cts +2 -13
  13. package/dist/types/build.d.mts +2 -13
  14. package/dist/types/index.d.cts +3 -3
  15. package/dist/types/index.d.mts +3 -3
  16. package/dist/types/plugin.d.cts +3 -5
  17. package/dist/types/plugin.d.cts.map +1 -1
  18. package/dist/types/plugin.d.mts +3 -5
  19. package/dist/types/plugin.d.mts.map +1 -1
  20. package/package.json +10 -12
  21. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  22. package/dist/helpers/index.cjs +0 -7
  23. package/dist/helpers/index.d.cts +0 -3
  24. package/dist/helpers/index.d.mts +0 -3
  25. package/dist/helpers/index.mjs +0 -4
  26. package/dist/helpers/resolve-options.cjs +0 -75
  27. package/dist/helpers/resolve-options.d.cts +0 -15
  28. package/dist/helpers/resolve-options.d.cts.map +0 -1
  29. package/dist/helpers/resolve-options.d.mts +0 -15
  30. package/dist/helpers/resolve-options.d.mts.map +0 -1
  31. package/dist/helpers/resolve-options.mjs +0 -72
  32. package/dist/helpers/resolve-options.mjs.map +0 -1
  33. package/dist/helpers/unplugin.cjs +0 -18
  34. package/dist/helpers/unplugin.d.cts +0 -8
  35. package/dist/helpers/unplugin.d.cts.map +0 -1
  36. package/dist/helpers/unplugin.d.mts +0 -8
  37. package/dist/helpers/unplugin.d.mts.map +0 -1
  38. package/dist/helpers/unplugin.mjs +0 -17
  39. package/dist/helpers/unplugin.mjs.map +0 -1
  40. package/dist/types/_internal.cjs +0 -0
  41. package/dist/types/_internal.d.cts +0 -14
  42. package/dist/types/_internal.d.cts.map +0 -1
  43. package/dist/types/_internal.d.mts +0 -14
  44. package/dist/types/_internal.d.mts.map +0 -1
  45. package/dist/types/_internal.mjs +0 -1
  46. package/dist/types/build.d.cts.map +0 -1
  47. package/dist/types/build.d.mts.map +0 -1
@@ -0,0 +1,13 @@
1
+ import { DepOptimizationOptions, UserConfig } from "vite";
2
+
3
+ //#region src/types/build.d.ts
4
+ type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external"> & {
5
+ /**
6
+ * Optimize deps config
7
+ */
8
+ optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
9
+ };
10
+ declare type __ΩViteOptions = any[];
11
+ //#endregion
12
+ export { __ΩViteOptions as n, ViteOptions as t };
13
+ //# sourceMappingURL=build-CksBpNAL.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-CksBpNAL.d.cts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}
@@ -0,0 +1,13 @@
1
+ import { DepOptimizationOptions, UserConfig } from "vite";
2
+
3
+ //#region src/types/build.d.ts
4
+ type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external"> & {
5
+ /**
6
+ * Optimize deps config
7
+ */
8
+ optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
9
+ };
10
+ declare type __ΩViteOptions = any[];
11
+ //#endregion
12
+ export { __ΩViteOptions as n, ViteOptions as t };
13
+ //# sourceMappingURL=build-DST9kC_L.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-DST9kC_L.d.mts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}
package/dist/index.cjs CHANGED
@@ -1,11 +1,38 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
4
- const require_helpers_unplugin = require('./helpers/unplugin.cjs');
5
- require('./helpers/index.cjs');
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+
28
+ //#endregion
29
+ require('./types/index.cjs');
30
+ let _powerlines_core = require("@powerlines/core");
6
31
  let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
32
+ let _powerlines_unplugin_vite = require("@powerlines/unplugin/vite");
7
33
  let defu = require("defu");
8
- defu = require_runtime.__toESM(defu, 1);
34
+ defu = __toESM(defu, 1);
35
+ let unplugin = require("unplugin");
9
36
  let vite = require("vite");
10
37
 
11
38
  //#region src/index.ts
@@ -19,23 +46,26 @@ const plugin = (options = {}) => {
19
46
  this.trace("Providing default configuration for the Powerlines `vite` build plugin.");
20
47
  return {
21
48
  output: { format: ["cjs", "esm"] },
22
- vite: {
23
- ...require_helpers_resolve_options.DEFAULT_VITE_CONFIG,
24
- ...options
25
- },
49
+ vite: { ...options },
26
50
  singleBuild: true
27
51
  };
28
52
  },
29
53
  async build() {
30
54
  this.debug("Starting Vite build process...");
31
- const environments = this?.$$internal?.api?.context?.environments;
55
+ const environments = this.environment.unstable_execution.environments;
32
56
  if (!environments || Object.keys(environments).length === 0) throw new Error(`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.`);
33
57
  this.trace(`Running Vite for ${Object.keys(environments).length} environments.`);
34
- const options = (0, defu.default)({
58
+ const resolved = (0, _powerlines_unplugin_vite.resolveOptions)(this);
59
+ const options = (0, defu.default)(this.config.vite, {
60
+ ...resolved,
35
61
  config: false,
36
62
  entry: this.entry,
37
- environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, require_helpers_resolve_options.resolveOptions(env)]))
38
- }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createVitePlugin(this)] });
63
+ environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, (0, defu.default)(this.config.vite, (0, _powerlines_unplugin_vite.resolveOptions)(env))])),
64
+ plugins: [(0, unplugin.createVitePlugin)((0, _powerlines_core.createUnplugin)(this, {
65
+ silenceHookLogging: true,
66
+ name: "vite"
67
+ }))()]
68
+ });
39
69
  this.debug({
40
70
  meta: { category: "config" },
41
71
  message: `Resolved Vite configuration: \n${(0, _powerlines_core_plugin_utils.formatConfig)(options)}`
@@ -46,8 +76,5 @@ const plugin = (options = {}) => {
46
76
  };
47
77
 
48
78
  //#endregion
49
- exports.DEFAULT_VITE_CONFIG = require_helpers_resolve_options.DEFAULT_VITE_CONFIG;
50
- exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
51
79
  exports.default = plugin;
52
- exports.plugin = plugin;
53
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
80
+ exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,5 @@
1
- import { ViteOptions, __ΩViteOptions } from "./types/build.cjs";
2
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.cjs";
3
- import { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.cjs";
4
- import { createVitePlugin } from "./helpers/unplugin.cjs";
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "./build-CksBpNAL.cjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.cjs";
5
3
  import { Plugin } from "@powerlines/core";
6
4
 
7
5
  //#region src/index.d.ts
@@ -15,5 +13,5 @@ declare module "@powerlines/core" {
15
13
  */
16
14
  declare const plugin: <TContext extends VitePluginContext = VitePluginContext>(options?: VitePluginOptions) => Plugin<TContext>;
17
15
  //#endregion
18
- export { DEFAULT_VITE_CONFIG, ViteOptions, VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig, createVitePlugin, plugin as default, plugin, resolveOptions };
16
+ export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig, plugin as default, plugin };
19
17
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YA+BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;AAJa;;;AAAA,cAWX,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA8BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;;;;cAOE,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,5 @@
1
- import { ViteOptions, __ΩViteOptions } from "./types/build.mjs";
2
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
3
- import { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.mjs";
4
- import { createVitePlugin } from "./helpers/unplugin.mjs";
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "./build-DST9kC_L.mjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.mjs";
5
3
  import { Plugin } from "@powerlines/core";
6
4
 
7
5
  //#region src/index.d.ts
@@ -15,5 +13,5 @@ declare module "@powerlines/core" {
15
13
  */
16
14
  declare const plugin: <TContext extends VitePluginContext = VitePluginContext>(options?: VitePluginOptions) => Plugin<TContext>;
17
15
  //#endregion
18
- export { DEFAULT_VITE_CONFIG, ViteOptions, VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig, createVitePlugin, plugin as default, plugin, resolveOptions };
16
+ export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig, plugin as default, plugin };
19
17
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YA+BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;AAJa;;;AAAA,cAWX,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA8BY,MAAA;IACR,IAAA,GAAO,iBAAA;EAAA;AAAA;;;;cAOE,MAAA,oBAA2B,iBAAA,GAAoB,iBAAA,EAC1D,OAAA,GAAS,iBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
2
- import { createVitePlugin } from "./helpers/unplugin.mjs";
3
- import "./helpers/index.mjs";
1
+ import "./types/index.mjs";
2
+ import { createUnplugin } from "@powerlines/core";
4
3
  import { formatConfig } from "@powerlines/core/plugin-utils";
4
+ import { resolveOptions } from "@powerlines/unplugin/vite";
5
5
  import defu from "defu";
6
+ import { createVitePlugin } from "unplugin";
6
7
  import { build } from "vite";
7
8
 
8
9
  //#region src/index.ts
@@ -16,23 +17,26 @@ const plugin = (options = {}) => {
16
17
  this.trace("Providing default configuration for the Powerlines `vite` build plugin.");
17
18
  return {
18
19
  output: { format: ["cjs", "esm"] },
19
- vite: {
20
- ...DEFAULT_VITE_CONFIG,
21
- ...options
22
- },
20
+ vite: { ...options },
23
21
  singleBuild: true
24
22
  };
25
23
  },
26
24
  async build() {
27
25
  this.debug("Starting Vite build process...");
28
- const environments = this?.$$internal?.api?.context?.environments;
26
+ const environments = this.environment.unstable_execution.environments;
29
27
  if (!environments || Object.keys(environments).length === 0) throw new Error(`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.`);
30
28
  this.trace(`Running Vite for ${Object.keys(environments).length} environments.`);
31
- const options = defu({
29
+ const resolved = resolveOptions(this);
30
+ const options = defu(this.config.vite, {
31
+ ...resolved,
32
32
  config: false,
33
33
  entry: this.entry,
34
- environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, resolveOptions(env)]))
35
- }, resolveOptions(this), { plugins: [createVitePlugin(this)] });
34
+ environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, defu(this.config.vite, resolveOptions(env))])),
35
+ plugins: [createVitePlugin(createUnplugin(this, {
36
+ silenceHookLogging: true,
37
+ name: "vite"
38
+ }))()]
39
+ });
36
40
  this.debug({
37
41
  meta: { category: "config" },
38
42
  message: `Resolved Vite configuration: \n${formatConfig(options)}`
@@ -43,5 +47,5 @@ const plugin = (options = {}) => {
43
47
  };
44
48
 
45
49
  //#endregion
46
- export { DEFAULT_VITE_CONFIG, createVitePlugin, plugin as default, plugin, resolveOptions };
50
+ export { plugin as default, plugin };
47
51
  //# sourceMappingURL=index.mjs.map
@@ -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 type { Context, Plugin } from \"@powerlines/core\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport defu from \"defu\";\nimport { build } from \"vite\";\nimport { DEFAULT_VITE_CONFIG, resolveOptions } from \"./helpers/resolve-options\";\nimport { createVitePlugin } from \"./helpers/unplugin\";\nimport { Unstable_VitePluginContext } from \"./types/_internal\";\nimport { VitePluginContext, VitePluginOptions } from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\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 };\n },\n async build() {\n this.debug(\"Starting Vite build process...\");\n\n const environments = (this as unknown as Unstable_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 options = 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 this.debug({\n meta: {\n category: \"config\"\n },\n message: `Resolved Vite configuration: \\n${formatConfig(options)}`\n });\n\n await build(options);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AAuCA,MAAa,UACX,UAA6B,EAAE,KACV;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,0EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,MAAM;KACJ,GAAG;KACH,GAAG;KACJ;IACD,aAAa;IACd;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,iCAAiC;GAE5C,MAAM,eAAgB,MAClB,YAAY,KAAK,SAAS;AAC9B,OAAI,CAAC,gBAAgB,OAAO,KAAK,aAAa,CAAC,WAAW,EACxD,OAAM,IAAI,MACR,0LACD;AAGH,QAAK,MACH,oBAAoB,OAAO,KAAK,aAAa,CAAC,OAAO,gBACtD;GAED,MAAM,UAAU,KACd;IACE,QAAQ;IACR,OAAO,KAAK;IACZ,cAAc,OAAO,YACnB,OAAO,QAAQ,aAAa,CAAC,KAAK,CAAC,MAAM,SAAS,CAChD,MACA,eAAe,IAAe,CAC/B,CAAC,CACH;IACF,EACD,eAAe,KAAK,EACpB,EACE,SAAS,CAAC,iBAAiB,KAAK,CAAC,EAClC,CACF;AAED,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,kCAAkC,aAAa,QAAQ;IACjE,CAAC;AAEF,SAAM,MAAM,QAAQ;;EAEvB"}
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 type { Context, Plugin } from \"@powerlines/core\";\nimport { createUnplugin } from \"@powerlines/core\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { resolveOptions } from \"@powerlines/unplugin/vite\";\nimport defu from \"defu\";\nimport { createVitePlugin } from \"unplugin\";\nimport { build, InlineConfig } from \"vite\";\nimport { VitePluginContext, VitePluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\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 ...options\n },\n singleBuild: true\n };\n },\n async build() {\n this.debug(\"Starting Vite build process...\");\n\n const environments = this.environment.unstable_execution.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 resolved = resolveOptions(this);\n const options = defu(this.config.vite, {\n ...resolved,\n config: false,\n entry: this.entry,\n environments: Object.fromEntries(\n Object.entries(environments).map(([name, env]) => [\n name,\n defu(this.config.vite, resolveOptions(env as Context))\n ])\n ),\n plugins: [\n createVitePlugin(\n createUnplugin(this, {\n silenceHookLogging: true,\n name: \"vite\"\n })\n )()\n ]\n }) as InlineConfig;\n\n this.debug({\n meta: {\n category: \"config\"\n },\n message: `Resolved Vite configuration: \\n${formatConfig(options)}`\n });\n\n await build(options);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AAsCA,MAAa,UACX,UAA6B,EAAE,KACV;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,QAAK,MACH,0EACD;AAED,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,MAAM,EACJ,GAAG,SACJ;IACD,aAAa;IACd;;EAEH,MAAM,QAAQ;AACZ,QAAK,MAAM,iCAAiC;GAE5C,MAAM,eAAe,KAAK,YAAY,mBAAmB;AACzD,OAAI,CAAC,gBAAgB,OAAO,KAAK,aAAa,CAAC,WAAW,EACxD,OAAM,IAAI,MACR,0LACD;AAGH,QAAK,MACH,oBAAoB,OAAO,KAAK,aAAa,CAAC,OAAO,gBACtD;GAED,MAAM,WAAW,eAAe,KAAK;GACrC,MAAM,UAAU,KAAK,KAAK,OAAO,MAAM;IACrC,GAAG;IACH,QAAQ;IACR,OAAO,KAAK;IACZ,cAAc,OAAO,YACnB,OAAO,QAAQ,aAAa,CAAC,KAAK,CAAC,MAAM,SAAS,CAChD,MACA,KAAK,KAAK,OAAO,MAAM,eAAe,IAAe,CAAC,CACvD,CAAC,CACH;IACD,SAAS,CACP,iBACE,eAAe,MAAM;KACnB,oBAAoB;KACpB,MAAM;KACP,CAAC,CACH,EAAE,CACJ;IACF,CAAC;AAEF,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,kCAAkC,aAAa,QAAQ;IACjE,CAAC;AAEF,SAAM,MAAM,QAAQ;;EAEvB"}
@@ -1,13 +1,2 @@
1
- import { DepOptimizationOptions, UserConfig } from "vite";
2
-
3
- //#region src/types/build.d.ts
4
- type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external"> & {
5
- /**
6
- * Optimize deps config
7
- */
8
- optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
9
- };
10
- declare type __ΩViteOptions = any[];
11
- //#endregion
12
- export { ViteOptions, __ΩViteOptions };
13
- //# sourceMappingURL=build.d.cts.map
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
2
+ export { ViteOptions, __ΩViteOptions };
@@ -1,13 +1,2 @@
1
- import { DepOptimizationOptions, UserConfig } from "vite";
2
-
3
- //#region src/types/build.d.ts
4
- type ViteOptions = Omit<UserConfig, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output" | "platform" | "define" | "external"> & {
5
- /**
6
- * Optimize deps config
7
- */
8
- optimizeDeps?: Omit<DepOptimizationOptions, "extensions">;
9
- };
10
- declare type __ΩViteOptions = any[];
11
- //#endregion
12
- export { ViteOptions, __ΩViteOptions };
13
- //# sourceMappingURL=build.d.mts.map
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
2
+ export { ViteOptions, __ΩViteOptions };
@@ -1,3 +1,3 @@
1
- import { ViteOptions, __ΩViteOptions } from "./build.cjs";
2
- import { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.cjs";
3
- export { ViteOptions, VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.cjs";
3
+ export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
@@ -1,3 +1,3 @@
1
- import { ViteOptions, __ΩViteOptions } from "./build.mjs";
2
- import { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.mjs";
3
- export { ViteOptions, VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
1
+ import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.mjs";
3
+ export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
@@ -1,12 +1,11 @@
1
- import { ViteOptions } from "./build.cjs";
2
- import { InitialPluginConfig, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
1
+ import { t as ViteOptions } from "../build-CksBpNAL.cjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type VitePluginOptions = Partial<ViteOptions>;
6
6
  interface VitePluginUserConfig extends UserConfig {
7
7
  vite?: VitePluginOptions;
8
8
  }
9
- type VitePluginInitialConfig = InitialPluginConfig<VitePluginUserConfig>;
10
9
  interface VitePluginResolvedConfig extends ResolvedConfig {
11
10
  vite: ViteOptions;
12
11
  }
@@ -15,9 +14,8 @@ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePl
15
14
  };
16
15
  declare type __ΩVitePluginOptions = any[];
17
16
  declare type __ΩVitePluginUserConfig = any[];
18
- declare type __ΩVitePluginInitialConfig = any[];
19
17
  declare type __ΩVitePluginResolvedConfig = any[];
20
18
  declare type __ΩVitePluginContext = any[];
21
19
  //#endregion
22
- export { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
20
+ export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
23
21
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,KAGG,uBAAA,GAA0B,mBAAA,CAAoB,oBAAA;AAAA,UAEzC,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;AAAA;AAAA"}
@@ -1,12 +1,11 @@
1
- import { ViteOptions } from "./build.mjs";
2
- import { InitialPluginConfig, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
1
+ import { t as ViteOptions } from "../build-DST9kC_L.mjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type VitePluginOptions = Partial<ViteOptions>;
6
6
  interface VitePluginUserConfig extends UserConfig {
7
7
  vite?: VitePluginOptions;
8
8
  }
9
- type VitePluginInitialConfig = InitialPluginConfig<VitePluginUserConfig>;
10
9
  interface VitePluginResolvedConfig extends ResolvedConfig {
11
10
  vite: ViteOptions;
12
11
  }
@@ -15,9 +14,8 @@ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePl
15
14
  };
16
15
  declare type __ΩVitePluginOptions = any[];
17
16
  declare type __ΩVitePluginUserConfig = any[];
18
- declare type __ΩVitePluginInitialConfig = any[];
19
17
  declare type __ΩVitePluginResolvedConfig = any[];
20
18
  declare type __ΩVitePluginContext = any[];
21
19
  //#endregion
22
- export { VitePluginContext, VitePluginInitialConfig, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginInitialConfig, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
20
+ export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
23
21
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,KAGG,uBAAA,GAA0B,mBAAA,CAAoB,oBAAA;AAAA,UAEzC,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,iBAAA,GAAoB,OAAA,CAAQ,WAAA;AAAA,UAEvB,oBAAA,SAA6B,UAAA;EAC5C,IAAA,GAAO,iBAAA;AAAA;AAAA,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;AAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-vite",
3
- "version": "0.14.458",
3
+ "version": "0.14.462",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "keywords": ["vite", "powerlines", "storm-software", "powerlines-plugin"],
@@ -12,7 +12,7 @@
12
12
  "repository": {
13
13
  "type": "github",
14
14
  "url": "https://github.com/storm-software/powerlines.git",
15
- "directory": "packages/plugin-vite"
15
+ "directory": "packages/plugins/plugin-vite"
16
16
  },
17
17
  "funding": {
18
18
  "type": "github",
@@ -75,19 +75,17 @@
75
75
  "module": "./dist/index.mjs",
76
76
  "types": "./dist/index.d.cts",
77
77
  "typings": "dist/index.d.mts",
78
- "files": ["dist/**/*"],
79
- "peerDependencies": { "vite": ">=8.0.0" },
80
- "peerDependenciesMeta": { "vite": { "optional": false } },
78
+ "files": ["dist"],
81
79
  "dependencies": {
82
- "@powerlines/core": "^0.47.3",
83
- "@powerlines/plugin-esbuild": "^0.13.460",
84
- "@powerlines/plugin-rolldown": "^0.7.461",
85
- "@powerlines/plugin-rollup": "^0.7.459",
86
- "@stryke/helpers": "^0.10.12",
80
+ "@powerlines/core": "^0.9.2",
81
+ "@powerlines/unplugin": "^0.0.4",
82
+ "@stryke/helpers": "^0.10.15",
87
83
  "defu": "^6.1.7",
88
84
  "unplugin": "^3.0.0"
89
85
  },
90
- "devDependencies": { "@types/node": "^25.6.0", "vite": "^8.0.10" },
86
+ "devDependencies": { "@types/node": "^25.7.0", "vite": "^8.0.12" },
87
+ "peerDependencies": { "vite": ">=8.0.0" },
88
+ "peerDependenciesMeta": { "vite": { "optional": false } },
91
89
  "publishConfig": { "access": "public" },
92
- "gitHead": "9c4b3c8956edda9e5f0f3354226077b0c25b09a2"
90
+ "gitHead": "3c5c701e16af74006dd70b965009d41eb22ace2a"
93
91
  }
@@ -1,29 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;
@@ -1,7 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_helpers_resolve_options = require('./resolve-options.cjs');
3
- const require_helpers_unplugin = require('./unplugin.cjs');
4
-
5
- exports.DEFAULT_VITE_CONFIG = require_helpers_resolve_options.DEFAULT_VITE_CONFIG;
6
- exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
7
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
@@ -1,3 +0,0 @@
1
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.cjs";
2
- import { createVitePlugin } from "./unplugin.cjs";
3
- export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
@@ -1,3 +0,0 @@
1
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.mjs";
2
- import { createVitePlugin } from "./unplugin.mjs";
3
- export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
@@ -1,4 +0,0 @@
1
- import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.mjs";
2
- import { createVitePlugin } from "./unplugin.mjs";
3
-
4
- export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
@@ -1,75 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let defu = require("defu");
4
- defu = require_runtime.__toESM(defu, 1);
5
- let _powerlines_plugin_esbuild_helpers_resolve_options = require("@powerlines/plugin-esbuild/helpers/resolve-options");
6
- let _powerlines_plugin_rolldown_helpers_resolve_options = require("@powerlines/plugin-rolldown/helpers/resolve-options");
7
- let _powerlines_plugin_rollup_helpers_resolve_options = require("@powerlines/plugin-rollup/helpers/resolve-options");
8
- let _stryke_path_append = require("@stryke/path/append");
9
- let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
10
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
11
-
12
- //#region src/helpers/resolve-options.ts
13
- const DEFAULT_VITE_CONFIG = {
14
- resolve: { extensions: [
15
- ".mjs",
16
- ".js",
17
- ".mts",
18
- ".ts",
19
- ".jsx",
20
- ".tsx",
21
- ".json"
22
- ] },
23
- json: { stringify: true },
24
- logLevel: "silent",
25
- clearScreen: true
26
- };
27
- /**
28
- * Resolves the options for [vite](https://vitejs.dev/).
29
- *
30
- * @param context - The build context.
31
- * @returns The resolved options.
32
- */
33
- function resolveOptions(context) {
34
- return (0, defu.default)({ resolve: {
35
- alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
36
- if (!ret.find((e) => e.find === id)) ret.push({
37
- find: id,
38
- replacement: path
39
- });
40
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
41
- return ret;
42
- }, []),
43
- dedupe: context.config.resolve.dedupe,
44
- mainFields: context.config.resolve.mainFields,
45
- conditions: context.config.resolve.conditions,
46
- extensions: context.config.resolve.extensions
47
- } }, context.config.vite ? (0, defu.default)(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
48
- define: context.config.define,
49
- root: (0, _stryke_path_append.appendPath)(context.config.root, context.config.cwd),
50
- platform: context.config.platform,
51
- mode: context.config.mode === "development" ? "development" : "production",
52
- cacheDir: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "vite"),
53
- build: {
54
- minify: context.config.output.minify,
55
- metafile: context.config.mode === "development",
56
- sourcemap: context.config.output.sourceMap,
57
- outDir: (0, _stryke_path_file_path_fns.relativePath)((0, _stryke_path_append.appendPath)(context.config.root, context.config.cwd), context.config.output.path),
58
- tsconfig: (0, _stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.config.cwd),
59
- tsconfigRaw: context.tsconfig.tsconfigJson
60
- },
61
- esbuild: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context),
62
- optimizeDeps: {
63
- rolldownOptions: (0, _powerlines_plugin_rolldown_helpers_resolve_options.resolveOptions)(context),
64
- rollupOptions: (0, _powerlines_plugin_rollup_helpers_resolve_options.resolveOptions)(context),
65
- esbuildOptions: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context)
66
- },
67
- logLevel: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
68
- clearScreen: true,
69
- envDir: context.config.root
70
- }, DEFAULT_VITE_CONFIG);
71
- }
72
-
73
- //#endregion
74
- exports.DEFAULT_VITE_CONFIG = DEFAULT_VITE_CONFIG;
75
- exports.resolveOptions = resolveOptions;
@@ -1,15 +0,0 @@
1
- import { ViteOptions } from "../types/build.cjs";
2
- import { Context } from "@powerlines/core";
3
-
4
- //#region src/helpers/resolve-options.d.ts
5
- declare const DEFAULT_VITE_CONFIG: Partial<ViteOptions>;
6
- /**
7
- * Resolves the options for [vite](https://vitejs.dev/).
8
- *
9
- * @param context - The build context.
10
- * @returns The resolved options.
11
- */
12
- declare function resolveOptions(context: Context): ViteOptions;
13
- //#endregion
14
- export { DEFAULT_VITE_CONFIG, resolveOptions };
15
- //# sourceMappingURL=resolve-options.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;cA8Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,15 +0,0 @@
1
- import { ViteOptions } from "../types/build.mjs";
2
- import { Context } from "@powerlines/core";
3
-
4
- //#region src/helpers/resolve-options.d.ts
5
- declare const DEFAULT_VITE_CONFIG: Partial<ViteOptions>;
6
- /**
7
- * Resolves the options for [vite](https://vitejs.dev/).
8
- *
9
- * @param context - The build context.
10
- * @returns The resolved options.
11
- */
12
- declare function resolveOptions(context: Context): ViteOptions;
13
- //#endregion
14
- export { DEFAULT_VITE_CONFIG, resolveOptions };
15
- //# sourceMappingURL=resolve-options.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;cA8Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,72 +0,0 @@
1
- import defu from "defu";
2
- import { resolveOptions as resolveOptions$1 } from "@powerlines/plugin-esbuild/helpers/resolve-options";
3
- import { resolveOptions as resolveOptions$2 } from "@powerlines/plugin-rolldown/helpers/resolve-options";
4
- import { resolveOptions as resolveOptions$3 } from "@powerlines/plugin-rollup/helpers/resolve-options";
5
- import { appendPath } from "@stryke/path/append";
6
- import { relativePath } from "@stryke/path/file-path-fns";
7
- import { joinPaths } from "@stryke/path/join-paths";
8
-
9
- //#region src/helpers/resolve-options.ts
10
- const DEFAULT_VITE_CONFIG = {
11
- resolve: { extensions: [
12
- ".mjs",
13
- ".js",
14
- ".mts",
15
- ".ts",
16
- ".jsx",
17
- ".tsx",
18
- ".json"
19
- ] },
20
- json: { stringify: true },
21
- logLevel: "silent",
22
- clearScreen: true
23
- };
24
- /**
25
- * Resolves the options for [vite](https://vitejs.dev/).
26
- *
27
- * @param context - The build context.
28
- * @returns The resolved options.
29
- */
30
- function resolveOptions(context) {
31
- return defu({ resolve: {
32
- alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
33
- if (!ret.find((e) => e.find === id)) ret.push({
34
- find: id,
35
- replacement: path
36
- });
37
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
38
- return ret;
39
- }, []),
40
- dedupe: context.config.resolve.dedupe,
41
- mainFields: context.config.resolve.mainFields,
42
- conditions: context.config.resolve.conditions,
43
- extensions: context.config.resolve.extensions
44
- } }, context.config.vite ? defu(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
45
- define: context.config.define,
46
- root: appendPath(context.config.root, context.config.cwd),
47
- platform: context.config.platform,
48
- mode: context.config.mode === "development" ? "development" : "production",
49
- cacheDir: joinPaths(context.cachePath, "vite"),
50
- build: {
51
- minify: context.config.output.minify,
52
- metafile: context.config.mode === "development",
53
- sourcemap: context.config.output.sourceMap,
54
- outDir: relativePath(appendPath(context.config.root, context.config.cwd), context.config.output.path),
55
- tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.config.cwd),
56
- tsconfigRaw: context.tsconfig.tsconfigJson
57
- },
58
- esbuild: resolveOptions$1(context),
59
- optimizeDeps: {
60
- rolldownOptions: resolveOptions$2(context),
61
- rollupOptions: resolveOptions$3(context),
62
- esbuildOptions: resolveOptions$1(context)
63
- },
64
- logLevel: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
65
- clearScreen: true,
66
- envDir: context.config.root
67
- }, DEFAULT_VITE_CONFIG);
68
- }
69
-
70
- //#endregion
71
- export { DEFAULT_VITE_CONFIG, resolveOptions };
72
- //# sourceMappingURL=resolve-options.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.mjs","names":["resolveEsbuildOptions","resolveRolldownOptions","resolveRollupOptions"],"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 { 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 { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\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 root: appendPath(context.config.root, context.config.cwd),\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.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap,\n outDir: relativePath(\n appendPath(context.config.root, context.config.cwd),\n context.config.output.path\n ),\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.config.cwd\n ),\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:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"error\",\n clearScreen: true,\n envDir: context.config.root\n } as ViteOptions,\n DEFAULT_VITE_CONFIG\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,MAAa,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,EAAE,CACH;EACD,QAAQ,QAAQ,OAAO,QAAQ;EAC/B,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACpC,EACF,EACA,QAAQ,OAAoC,OACzC,KACG,QAAQ,OAAoC,MAC7C,EACE,cACG,QAAQ,OAAoC,MAAM,gBACnD,EAAE,EACL,EACD,EACE,cAAc,EACZ,YAAY,QAAQ,OAAO,QAAQ,YACpC,EACF,CACF,GACD,EAAE,EACN;EACE,QAAQ,QAAQ,OAAO;EACvB,MAAM,WAAW,QAAQ,OAAO,MAAM,QAAQ,OAAO,IAAI;EACzD,UAAU,QAAQ,OAAO;EACzB,MACE,QAAQ,OAAO,SAAS,gBAAgB,gBAAgB;EAC1D,UAAU,UAAU,QAAQ,WAAW,OAAO;EAC9C,OAAO;GACL,QAAQ,QAAQ,OAAO,OAAO;GAC9B,UAAU,QAAQ,OAAO,SAAS;GAClC,WAAW,QAAQ,OAAO,OAAO;GACjC,QAAQ,aACN,WAAW,QAAQ,OAAO,MAAM,QAAQ,OAAO,IAAI,EACnD,QAAQ,OAAO,OAAO,KACvB;GACD,UAAU,WACR,QAAQ,SAAS,kBACjB,QAAQ,OAAO,IAChB;GACD,aAAa,QAAQ,SAAS;GAC/B;EACD,SAASA,iBAAsB,QAAQ;EACvC,cAAc;GACZ,iBAAiBC,iBAAuB,QAAQ;GAChD,eAAeC,iBAAqB,QAAQ;GAC5C,gBAAgBF,iBAAsB,QAAQ;GAC/C;EACD,UACE,QAAQ,OAAO,SAAS,YAAY,UAChC,UACA,QAAQ,OAAO,SAAS,YAAY,UAClC,SACA;EACR,aAAa;EACb,QAAQ,QAAQ,OAAO;EACxB,EACD,oBACD"}
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
4
- let unplugin = require("unplugin");
5
-
6
- //#region src/helpers/unplugin.ts
7
- function createVitePlugin(context) {
8
- return (0, unplugin.createVitePlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context, {
9
- silenceHookLogging: true,
10
- name: "vite"
11
- }))({
12
- ...context.options,
13
- ...context.config.initialConfig
14
- });
15
- }
16
-
17
- //#endregion
18
- exports.createVitePlugin = createVitePlugin;
@@ -1,8 +0,0 @@
1
- import { VitePluginContext } from "../types/plugin.cjs";
2
- import * as _$vite from "vite";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createVitePlugin(context: VitePluginContext): _$vite.Plugin<any> | _$vite.Plugin<any>[];
6
- //#endregion
7
- export { createVitePlugin };
8
- //# sourceMappingURL=unplugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,MAAA,CAAA,MAAA,QAAA,MAAA,CAAA,MAAA"}
@@ -1,8 +0,0 @@
1
- import { VitePluginContext } from "../types/plugin.mjs";
2
- import * as _$vite from "vite";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createVitePlugin(context: VitePluginContext): _$vite.Plugin<any> | _$vite.Plugin<any>[];
6
- //#endregion
7
- export { createVitePlugin };
8
- //# sourceMappingURL=unplugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,MAAA,CAAA,MAAA,QAAA,MAAA,CAAA,MAAA"}
@@ -1,17 +0,0 @@
1
- import { createUnplugin } from "@powerlines/core/lib/unplugin";
2
- import { createVitePlugin as createVitePlugin$1 } from "unplugin";
3
-
4
- //#region src/helpers/unplugin.ts
5
- function createVitePlugin(context) {
6
- return createVitePlugin$1(createUnplugin(context, {
7
- silenceHookLogging: true,
8
- name: "vite"
9
- }))({
10
- ...context.options,
11
- ...context.config.initialConfig
12
- });
13
- }
14
-
15
- //#endregion
16
- export { createVitePlugin };
17
- //# sourceMappingURL=unplugin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.mjs","names":["createViteUnplugin"],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createVitePlugin as createViteUnplugin } from \"unplugin\";\nimport { VitePluginContext } from \"../types/plugin\";\n\nexport function createVitePlugin(context: VitePluginContext) {\n return createViteUnplugin(\n createUnplugin(context, { silenceHookLogging: true, name: \"vite\" })\n )({ ...context.options, ...context.config.initialConfig });\n}\n"],"mappings":";;;;AAsBA,SAAgB,iBAAiB,SAA4B;AAC3D,QAAOA,mBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAQ,CAAC,CACpE,CAAC;EAAE,GAAG,QAAQ;EAAS,GAAG,QAAQ,OAAO;EAAe,CAAC"}
File without changes
@@ -1,14 +0,0 @@
1
- import { VitePluginResolvedConfig } from "./plugin.cjs";
2
- import { Unstable_PluginContext } from "@powerlines/core/types/_internal";
3
-
4
- //#region src/types/_internal.d.ts
5
- /**
6
- * Internal fields and methods for internal Vite plugin contexts
7
- *
8
- * @internal
9
- */
10
- type Unstable_VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = Unstable_PluginContext<TResolvedConfig>;
11
- declare type __ΩUnstable_VitePluginContext = any[];
12
- //#endregion
13
- export { Unstable_VitePluginContext, __ΩUnstable_VitePluginContext };
14
- //# sourceMappingURL=_internal.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;AA0BA;;;KAAY,0BAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,sBAAA,CAAuB,eAAA;AAAA"}
@@ -1,14 +0,0 @@
1
- import { VitePluginResolvedConfig } from "./plugin.mjs";
2
- import { Unstable_PluginContext } from "@powerlines/core/types/_internal";
3
-
4
- //#region src/types/_internal.d.ts
5
- /**
6
- * Internal fields and methods for internal Vite plugin contexts
7
- *
8
- * @internal
9
- */
10
- type Unstable_VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = Unstable_PluginContext<TResolvedConfig>;
11
- declare type __ΩUnstable_VitePluginContext = any[];
12
- //#endregion
13
- export { Unstable_VitePluginContext, __ΩUnstable_VitePluginContext };
14
- //# sourceMappingURL=_internal.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;AA0BA;;;KAAY,0BAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,sBAAA,CAAuB,eAAA;AAAA"}
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,WAAA,GAAc,IAAA,CACxB,UAAA;;AADF;;EAeE,YAAA,GAAe,IAAA,CAAK,sBAAA;AAAA;AAAA"}