@powerlines/plugin-vite 0.14.343 → 0.14.345

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 (50) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/helpers/index.cjs +3 -3
  3. package/dist/helpers/index.d.cts +2 -2
  4. package/dist/helpers/index.d.mts +2 -2
  5. package/dist/helpers/resolve-options.cjs +70 -3
  6. package/dist/helpers/resolve-options.d.cts +15 -2
  7. package/dist/helpers/resolve-options.d.cts.map +1 -0
  8. package/dist/helpers/resolve-options.d.mts +15 -2
  9. package/dist/helpers/resolve-options.d.mts.map +1 -0
  10. package/dist/helpers/unplugin.cjs +1 -1
  11. package/dist/helpers/unplugin.d.cts +8 -2
  12. package/dist/helpers/unplugin.d.cts.map +1 -0
  13. package/dist/helpers/unplugin.d.mts +8 -2
  14. package/dist/helpers/unplugin.d.mts.map +1 -0
  15. package/dist/index.cjs +8 -8
  16. package/dist/index.d.cts +4 -4
  17. package/dist/index.d.mts +4 -4
  18. package/dist/index.mjs +0 -1
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/types/_internal.d.cts +1 -1
  21. package/dist/types/_internal.d.mts +1 -1
  22. package/dist/types/_internal.d.mts.map +1 -1
  23. package/dist/types/build.d.cts +13 -2
  24. package/dist/types/build.d.cts.map +1 -0
  25. package/dist/types/build.d.mts +13 -2
  26. package/dist/types/build.d.mts.map +1 -0
  27. package/dist/types/index.d.cts +2 -2
  28. package/dist/types/index.d.mts +2 -2
  29. package/dist/types/plugin.d.cts +22 -2
  30. package/dist/types/plugin.d.cts.map +1 -0
  31. package/dist/types/plugin.d.mts +22 -2
  32. package/dist/types/plugin.d.mts.map +1 -0
  33. package/package.json +7 -8
  34. package/dist/build-CksBpNAL.d.cts +0 -13
  35. package/dist/build-CksBpNAL.d.cts.map +0 -1
  36. package/dist/build-DST9kC_L.d.mts +0 -13
  37. package/dist/build-DST9kC_L.d.mts.map +0 -1
  38. package/dist/plugin-Bh-B80x0.d.cts +0 -22
  39. package/dist/plugin-Bh-B80x0.d.cts.map +0 -1
  40. package/dist/plugin-DE3oU3V6.d.mts +0 -22
  41. package/dist/plugin-DE3oU3V6.d.mts.map +0 -1
  42. package/dist/resolve-options-BxqjvL8P.d.mts +0 -15
  43. package/dist/resolve-options-BxqjvL8P.d.mts.map +0 -1
  44. package/dist/resolve-options-DZOdIilz.cjs +0 -113
  45. package/dist/resolve-options-MOVKz6QN.d.cts +0 -15
  46. package/dist/resolve-options-MOVKz6QN.d.cts.map +0 -1
  47. package/dist/unplugin-Cs_a2k7X.d.mts +0 -8
  48. package/dist/unplugin-Cs_a2k7X.d.mts.map +0 -1
  49. package/dist/unplugin-Csj_0MkH.d.cts +0 -8
  50. package/dist/unplugin-Csj_0MkH.d.cts.map +0 -1
@@ -0,0 +1,29 @@
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 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
2
+ const require_helpers_resolve_options = require('./resolve-options.cjs');
3
3
  const require_helpers_unplugin = require('./unplugin.cjs');
4
4
 
5
- exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
5
+ exports.DEFAULT_VITE_CONFIG = require_helpers_resolve_options.DEFAULT_VITE_CONFIG;
6
6
  exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
7
- exports.resolveOptions = require_resolve_options.resolveOptions;
7
+ exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
@@ -1,3 +1,3 @@
1
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-MOVKz6QN.cjs";
2
- import { t as createVitePlugin } from "../unplugin-Csj_0MkH.cjs";
1
+ import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.cjs";
2
+ import { createVitePlugin } from "./unplugin.cjs";
3
3
  export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
@@ -1,3 +1,3 @@
1
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-BxqjvL8P.mjs";
2
- import { t as createVitePlugin } from "../unplugin-Cs_a2k7X.mjs";
1
+ import { DEFAULT_VITE_CONFIG, resolveOptions } from "./resolve-options.mjs";
2
+ import { createVitePlugin } from "./unplugin.mjs";
3
3
  export { DEFAULT_VITE_CONFIG, createVitePlugin, resolveOptions };
@@ -1,5 +1,72 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let defu = require("defu");
4
+ defu = require_runtime.__toESM(defu);
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_join_paths = require("@stryke/path/join-paths");
3
9
 
4
- exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
5
- exports.resolveOptions = require_resolve_options.resolveOptions;
10
+ //#region src/helpers/resolve-options.ts
11
+ const DEFAULT_VITE_CONFIG = {
12
+ resolve: { extensions: [
13
+ ".mjs",
14
+ ".js",
15
+ ".mts",
16
+ ".ts",
17
+ ".jsx",
18
+ ".tsx",
19
+ ".json"
20
+ ] },
21
+ json: { stringify: true },
22
+ logLevel: "silent",
23
+ clearScreen: true
24
+ };
25
+ /**
26
+ * Resolves the options for [vite](https://vitejs.dev/).
27
+ *
28
+ * @param context - The build context.
29
+ * @returns The resolved options.
30
+ */
31
+ function resolveOptions(context) {
32
+ return (0, defu.default)({ resolve: {
33
+ alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
34
+ if (!ret.find((e) => e.find === id)) ret.push({
35
+ find: id,
36
+ replacement: path
37
+ });
38
+ else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
39
+ return ret;
40
+ }, []),
41
+ dedupe: context.config.resolve.dedupe,
42
+ mainFields: context.config.resolve.mainFields,
43
+ conditions: context.config.resolve.conditions,
44
+ extensions: context.config.resolve.extensions
45
+ } }, context.config.vite ? (0, defu.default)(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
46
+ define: context.config.define,
47
+ rootDir: context.fs.existsSync((0, _stryke_path_join_paths.joinPaths)(context.config.root, "src")) ? (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src") : context.config.root,
48
+ platform: context.config.platform,
49
+ mode: context.config.mode === "development" ? "development" : "production",
50
+ cacheDir: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "vite"),
51
+ build: {
52
+ minify: context.config.mode !== "development",
53
+ metafile: context.config.mode === "development",
54
+ sourcemap: context.config.mode === "development",
55
+ outDir: context.config.output.buildPath,
56
+ tsconfig: context.tsconfig.tsconfigFilePath,
57
+ tsconfigRaw: context.tsconfig.tsconfigJson
58
+ },
59
+ esbuild: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context),
60
+ optimizeDeps: {
61
+ rolldownOptions: (0, _powerlines_plugin_rolldown_helpers_resolve_options.resolveOptions)(context),
62
+ rollupOptions: (0, _powerlines_plugin_rollup_helpers_resolve_options.resolveOptions)(context),
63
+ esbuildOptions: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context)
64
+ },
65
+ logLevel: context.config.logLevel ?? void 0,
66
+ envDir: context.config.root
67
+ }, DEFAULT_VITE_CONFIG);
68
+ }
69
+
70
+ //#endregion
71
+ exports.DEFAULT_VITE_CONFIG = DEFAULT_VITE_CONFIG;
72
+ exports.resolveOptions = resolveOptions;
@@ -1,2 +1,15 @@
1
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-MOVKz6QN.cjs";
2
- export { DEFAULT_VITE_CONFIG, resolveOptions };
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,2 +1,15 @@
1
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "../resolve-options-BxqjvL8P.mjs";
2
- export { DEFAULT_VITE_CONFIG, resolveOptions };
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_resolve_options = require('../resolve-options-DZOdIilz.cjs');
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
4
4
  let unplugin = require("unplugin");
5
5
 
@@ -1,2 +1,8 @@
1
- import { t as createVitePlugin } from "../unplugin-Csj_0MkH.cjs";
2
- export { createVitePlugin };
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}
@@ -1,2 +1,8 @@
1
- import { t as createVitePlugin } from "../unplugin-Cs_a2k7X.mjs";
2
- export { createVitePlugin };
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_resolve_options = require('./resolve-options-DZOdIilz.cjs');
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
3
4
  const require_helpers_unplugin = require('./helpers/unplugin.cjs');
4
5
  require('./helpers/index.cjs');
5
- require('./types/index.cjs');
6
6
  let defu = require("defu");
7
- defu = require_resolve_options.__toESM(defu);
7
+ defu = require_runtime.__toESM(defu);
8
8
  let vite = require("vite");
9
9
 
10
10
  //#region src/index.ts
@@ -19,7 +19,7 @@ const plugin = (options = {}) => {
19
19
  return {
20
20
  output: { format: ["cjs", "esm"] },
21
21
  vite: {
22
- ...require_resolve_options.DEFAULT_VITE_CONFIG,
22
+ ...require_helpers_resolve_options.DEFAULT_VITE_CONFIG,
23
23
  ...options
24
24
  },
25
25
  singleBuild: true
@@ -33,15 +33,15 @@ const plugin = (options = {}) => {
33
33
  await (0, vite.build)((0, defu.default)({
34
34
  config: false,
35
35
  entry: this.entry,
36
- environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, require_resolve_options.resolveOptions(env)]))
37
- }, require_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createVitePlugin(this)] }));
36
+ environments: Object.fromEntries(Object.entries(environments).map(([name, env]) => [name, require_helpers_resolve_options.resolveOptions(env)]))
37
+ }, require_helpers_resolve_options.resolveOptions(this), { plugins: [require_helpers_unplugin.createVitePlugin(this)] }));
38
38
  }
39
39
  };
40
40
  };
41
41
 
42
42
  //#endregion
43
- exports.DEFAULT_VITE_CONFIG = require_resolve_options.DEFAULT_VITE_CONFIG;
43
+ exports.DEFAULT_VITE_CONFIG = require_helpers_resolve_options.DEFAULT_VITE_CONFIG;
44
44
  exports.createVitePlugin = require_helpers_unplugin.createVitePlugin;
45
45
  exports.default = plugin;
46
46
  exports.plugin = plugin;
47
- exports.resolveOptions = require_resolve_options.resolveOptions;
47
+ exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "./build-CksBpNAL.cjs";
2
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-MOVKz6QN.cjs";
3
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-Bh-B80x0.cjs";
4
- import { t as createVitePlugin } from "./unplugin-Csj_0MkH.cjs";
1
+ import { ViteOptions, __ΩViteOptions } from "./types/build.cjs";
2
+ import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.cjs";
3
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.cjs";
4
+ import { createVitePlugin } from "./helpers/unplugin.cjs";
5
5
  import { Plugin } from "@powerlines/core";
6
6
 
7
7
  //#region src/index.d.ts
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "./build-DST9kC_L.mjs";
2
- import { n as resolveOptions, t as DEFAULT_VITE_CONFIG } from "./resolve-options-BxqjvL8P.mjs";
3
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "./plugin-DE3oU3V6.mjs";
4
- import { t as createVitePlugin } from "./unplugin-Cs_a2k7X.mjs";
1
+ import { ViteOptions, __ΩViteOptions } from "./types/build.mjs";
2
+ import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
3
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./types/plugin.mjs";
4
+ import { createVitePlugin } from "./helpers/unplugin.mjs";
5
5
  import { Plugin } from "@powerlines/core";
6
6
 
7
7
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { DEFAULT_VITE_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
2
2
  import { createVitePlugin } from "./helpers/unplugin.mjs";
3
3
  import "./helpers/index.mjs";
4
- import "./types/index.mjs";
5
4
  import defu from "defu";
6
5
  import { build } from "vite";
7
6
 
@@ -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 { 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 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 } 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"],"mappings":";;;;;;;;;;;AA0CA,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,kCAAkC;GAE7C,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;AAmBD,SAAM,MAjBS,KACb;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,CAEkC;;EAEtC"}
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 { 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 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 } 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"],"mappings":";;;;;;;;;;AA0CA,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,kCAAkC;GAE7C,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;AAmBD,SAAM,MAjBS,KACb;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,CAEkC;;EAEtC"}
@@ -1,4 +1,4 @@
1
- import { r as VitePluginResolvedConfig } from "../plugin-Bh-B80x0.cjs";
1
+ import { VitePluginResolvedConfig } from "./plugin.cjs";
2
2
  import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
3
3
 
4
4
  //#region src/types/_internal.d.ts
@@ -1,4 +1,4 @@
1
- import { r as VitePluginResolvedConfig } from "../plugin-DE3oU3V6.mjs";
1
+ import { VitePluginResolvedConfig } from "./plugin.mjs";
2
2
  import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
3
3
 
4
4
  //#region src/types/_internal.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;;AA0BA;;KAAY,wBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,oBAAA,CAAqB,eAAA;AAAA"}
1
+ {"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"mappings":";;;;;;AA0BA;;;KAAY,wBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,oBAAA,CAAqB,eAAA;AAAA"}
@@ -1,2 +1,13 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
2
- export { ViteOptions, __ΩViteOptions };
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
@@ -0,0 +1 @@
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,2 +1,13 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
2
- export { ViteOptions, __ΩViteOptions };
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
@@ -0,0 +1 @@
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"}
@@ -1,3 +1,3 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "../build-CksBpNAL.cjs";
2
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-Bh-B80x0.cjs";
1
+ import { ViteOptions, __ΩViteOptions } from "./build.cjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.cjs";
3
3
  export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
@@ -1,3 +1,3 @@
1
- import { n as __ΩViteOptions, t as ViteOptions } from "../build-DST9kC_L.mjs";
2
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DE3oU3V6.mjs";
1
+ import { ViteOptions, __ΩViteOptions } from "./build.mjs";
2
+ import { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig } from "./plugin.mjs";
3
3
  export { ViteOptions, VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩViteOptions, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
@@ -1,2 +1,22 @@
1
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-Bh-B80x0.cjs";
2
- export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
1
+ import { ViteOptions } from "./build.cjs";
2
+ import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type VitePluginOptions = Partial<ViteOptions>;
6
+ interface VitePluginUserConfig extends UserConfig {
7
+ vite?: VitePluginOptions;
8
+ }
9
+ interface VitePluginResolvedConfig extends ResolvedConfig {
10
+ vite: ViteOptions;
11
+ }
12
+ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig> & {
13
+ dev: boolean;
14
+ configEnv: ConfigEnv;
15
+ };
16
+ declare type __ΩVitePluginOptions = any[];
17
+ declare type __ΩVitePluginUserConfig = any[];
18
+ declare type __ΩVitePluginResolvedConfig = any[];
19
+ declare type __ΩVitePluginContext = any[];
20
+ //#endregion
21
+ export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
22
+ //# sourceMappingURL=plugin.d.cts.map
@@ -0,0 +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,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
@@ -1,2 +1,22 @@
1
- import { a as __ΩVitePluginContext, c as __ΩVitePluginUserConfig, i as VitePluginUserConfig, n as VitePluginOptions, o as __ΩVitePluginOptions, r as VitePluginResolvedConfig, s as __ΩVitePluginResolvedConfig, t as VitePluginContext } from "../plugin-DE3oU3V6.mjs";
2
- export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
1
+ import { ViteOptions } from "./build.mjs";
2
+ import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type VitePluginOptions = Partial<ViteOptions>;
6
+ interface VitePluginUserConfig extends UserConfig {
7
+ vite?: VitePluginOptions;
8
+ }
9
+ interface VitePluginResolvedConfig extends ResolvedConfig {
10
+ vite: ViteOptions;
11
+ }
12
+ type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig> & {
13
+ dev: boolean;
14
+ configEnv: ConfigEnv;
15
+ };
16
+ declare type __ΩVitePluginOptions = any[];
17
+ declare type __ΩVitePluginUserConfig = any[];
18
+ declare type __ΩVitePluginResolvedConfig = any[];
19
+ declare type __ΩVitePluginContext = any[];
20
+ //#endregion
21
+ export { VitePluginContext, VitePluginOptions, VitePluginResolvedConfig, VitePluginUserConfig, __ΩVitePluginContext, __ΩVitePluginOptions, __ΩVitePluginResolvedConfig, __ΩVitePluginUserConfig };
22
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +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,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-vite",
3
- "version": "0.14.343",
3
+ "version": "0.14.345",
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"],
@@ -53,7 +53,6 @@
53
53
  "import": "./dist/helpers/unplugin.mjs",
54
54
  "require": "./dist/helpers/unplugin.cjs"
55
55
  },
56
- "./resolve-options-DZOdIilz": "./dist/resolve-options-DZOdIilz.cjs",
57
56
  "./types": {
58
57
  "import": "./dist/types/index.mjs",
59
58
  "require": "./dist/types/index.cjs"
@@ -70,7 +69,7 @@
70
69
  "import": "./dist/types/plugin.mjs",
71
70
  "require": "./dist/types/plugin.cjs"
72
71
  },
73
- "./*": "./*"
72
+ "./package.json": "./package.json"
74
73
  },
75
74
  "main": "./dist/index.cjs",
76
75
  "module": "./dist/index.mjs",
@@ -80,14 +79,14 @@
80
79
  "peerDependencies": { "vite": ">=8.0.0-beta.16" },
81
80
  "peerDependenciesMeta": { "vite": { "optional": false } },
82
81
  "dependencies": {
83
- "@powerlines/core": "^0.3.2",
84
- "@powerlines/plugin-rolldown": "^0.7.350",
85
- "@powerlines/plugin-rollup": "^0.7.349",
86
- "@powerlines/plugin-esbuild": "^0.13.349",
82
+ "@powerlines/core": "^0.3.4",
83
+ "@powerlines/plugin-rolldown": "^0.7.352",
84
+ "@powerlines/plugin-rollup": "^0.7.351",
85
+ "@powerlines/plugin-esbuild": "^0.13.351",
87
86
  "defu": "^6.1.4",
88
87
  "unplugin": "^3.0.0"
89
88
  },
90
89
  "devDependencies": { "@types/node": "^25.5.0", "vite": "8.0.0-beta.16" },
91
90
  "publishConfig": { "access": "public" },
92
- "gitHead": "8ab1d6e9a7ab44ee184b19c58d6de2c4c101ec01"
91
+ "gitHead": "84f84362520b3532ac14ac03d6f634066e966127"
93
92
  }
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,22 +0,0 @@
1
- import { t as ViteOptions } from "./build-CksBpNAL.cjs";
2
- import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
-
4
- //#region src/types/plugin.d.ts
5
- type VitePluginOptions = Partial<ViteOptions>;
6
- interface VitePluginUserConfig extends UserConfig {
7
- vite?: VitePluginOptions;
8
- }
9
- interface VitePluginResolvedConfig extends ResolvedConfig {
10
- vite: ViteOptions;
11
- }
12
- type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig> & {
13
- dev: boolean;
14
- configEnv: ConfigEnv;
15
- };
16
- declare type __ΩVitePluginOptions = any[];
17
- declare type __ΩVitePluginUserConfig = any[];
18
- declare type __ΩVitePluginResolvedConfig = any[];
19
- declare type __ΩVitePluginContext = any[];
20
- //#endregion
21
- export { __ΩVitePluginContext as a, __ΩVitePluginUserConfig as c, VitePluginUserConfig as i, VitePluginOptions as n, __ΩVitePluginOptions as o, VitePluginResolvedConfig as r, __ΩVitePluginResolvedConfig as s, VitePluginContext as t };
22
- //# sourceMappingURL=plugin-Bh-B80x0.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-Bh-B80x0.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,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
@@ -1,22 +0,0 @@
1
- import { t as ViteOptions } from "./build-DST9kC_L.mjs";
2
- import { ConfigEnv, PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
-
4
- //#region src/types/plugin.d.ts
5
- type VitePluginOptions = Partial<ViteOptions>;
6
- interface VitePluginUserConfig extends UserConfig {
7
- vite?: VitePluginOptions;
8
- }
9
- interface VitePluginResolvedConfig extends ResolvedConfig {
10
- vite: ViteOptions;
11
- }
12
- type VitePluginContext<TResolvedConfig extends VitePluginResolvedConfig = VitePluginResolvedConfig> = PluginContext<TResolvedConfig> & {
13
- dev: boolean;
14
- configEnv: ConfigEnv;
15
- };
16
- declare type __ΩVitePluginOptions = any[];
17
- declare type __ΩVitePluginUserConfig = any[];
18
- declare type __ΩVitePluginResolvedConfig = any[];
19
- declare type __ΩVitePluginContext = any[];
20
- //#endregion
21
- export { __ΩVitePluginContext as a, __ΩVitePluginUserConfig as c, VitePluginUserConfig as i, VitePluginOptions as n, __ΩVitePluginOptions as o, VitePluginResolvedConfig as r, __ΩVitePluginResolvedConfig as s, VitePluginContext as t };
22
- //# sourceMappingURL=plugin-DE3oU3V6.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-DE3oU3V6.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,UAGQ,wBAAA,SAAiC,cAAA;EAChD,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,iBAAA,yBACc,wBAAA,GAA2B,wBAAA,IACjD,aAAA,CAAc,eAAA;EAChB,GAAA;EACA,SAAA,EAAW,SAAA;AAAA;AAAA"}
@@ -1,15 +0,0 @@
1
- import { t as ViteOptions } from "./build-DST9kC_L.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 { resolveOptions as n, DEFAULT_VITE_CONFIG as t };
15
- //# sourceMappingURL=resolve-options-BxqjvL8P.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options-BxqjvL8P.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,113 +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
- let defu = require("defu");
29
- defu = __toESM(defu);
30
- let _powerlines_plugin_esbuild_helpers_resolve_options = require("@powerlines/plugin-esbuild/helpers/resolve-options");
31
- let _powerlines_plugin_rolldown_helpers_resolve_options = require("@powerlines/plugin-rolldown/helpers/resolve-options");
32
- let _powerlines_plugin_rollup_helpers_resolve_options = require("@powerlines/plugin-rollup/helpers/resolve-options");
33
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
34
-
35
- //#region src/helpers/resolve-options.ts
36
- const DEFAULT_VITE_CONFIG = {
37
- resolve: { extensions: [
38
- ".mjs",
39
- ".js",
40
- ".mts",
41
- ".ts",
42
- ".jsx",
43
- ".tsx",
44
- ".json"
45
- ] },
46
- json: { stringify: true },
47
- logLevel: "silent",
48
- clearScreen: true
49
- };
50
- /**
51
- * Resolves the options for [vite](https://vitejs.dev/).
52
- *
53
- * @param context - The build context.
54
- * @returns The resolved options.
55
- */
56
- function resolveOptions(context) {
57
- return (0, defu.default)({ resolve: {
58
- alias: Object.entries(context.alias).reduce((ret, [id, path]) => {
59
- if (!ret.find((e) => e.find === id)) ret.push({
60
- find: id,
61
- replacement: path
62
- });
63
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
64
- return ret;
65
- }, []),
66
- dedupe: context.config.resolve.dedupe,
67
- mainFields: context.config.resolve.mainFields,
68
- conditions: context.config.resolve.conditions,
69
- extensions: context.config.resolve.extensions
70
- } }, context.config.vite ? (0, defu.default)(context.config.vite, { optimizeDeps: context.config.vite?.optimizeDeps ?? {} }, { optimizeDeps: { extensions: context.config.resolve.extensions } }) : {}, {
71
- define: context.config.define,
72
- rootDir: context.fs.existsSync((0, _stryke_path_join_paths.joinPaths)(context.config.root, "src")) ? (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src") : context.config.root,
73
- platform: context.config.platform,
74
- mode: context.config.mode === "development" ? "development" : "production",
75
- cacheDir: (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "vite"),
76
- build: {
77
- minify: context.config.mode !== "development",
78
- metafile: context.config.mode === "development",
79
- sourcemap: context.config.mode === "development",
80
- outDir: context.config.output.buildPath,
81
- tsconfig: context.tsconfig.tsconfigFilePath,
82
- tsconfigRaw: context.tsconfig.tsconfigJson
83
- },
84
- esbuild: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context),
85
- optimizeDeps: {
86
- rolldownOptions: (0, _powerlines_plugin_rolldown_helpers_resolve_options.resolveOptions)(context),
87
- rollupOptions: (0, _powerlines_plugin_rollup_helpers_resolve_options.resolveOptions)(context),
88
- esbuildOptions: (0, _powerlines_plugin_esbuild_helpers_resolve_options.resolveOptions)(context)
89
- },
90
- logLevel: context.config.logLevel ?? void 0,
91
- envDir: context.config.root
92
- }, DEFAULT_VITE_CONFIG);
93
- }
94
-
95
- //#endregion
96
- Object.defineProperty(exports, 'DEFAULT_VITE_CONFIG', {
97
- enumerable: true,
98
- get: function () {
99
- return DEFAULT_VITE_CONFIG;
100
- }
101
- });
102
- Object.defineProperty(exports, '__toESM', {
103
- enumerable: true,
104
- get: function () {
105
- return __toESM;
106
- }
107
- });
108
- Object.defineProperty(exports, 'resolveOptions', {
109
- enumerable: true,
110
- get: function () {
111
- return resolveOptions;
112
- }
113
- });
@@ -1,15 +0,0 @@
1
- import { t as ViteOptions } from "./build-CksBpNAL.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 { resolveOptions as n, DEFAULT_VITE_CONFIG as t };
15
- //# sourceMappingURL=resolve-options-MOVKz6QN.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options-MOVKz6QN.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;cA4Ba,mBAAA,EAAqB,OAAA,CAAQ,WAAA;;AAA1C;;;;;iBAiBgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,WAAA"}
@@ -1,8 +0,0 @@
1
- import { t as VitePluginContext } from "./plugin-DE3oU3V6.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 as t };
8
- //# sourceMappingURL=unplugin-Cs_a2k7X.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-Cs_a2k7X.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}
@@ -1,8 +0,0 @@
1
- import { t as VitePluginContext } from "./plugin-Bh-B80x0.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 as t };
8
- //# sourceMappingURL=unplugin-Csj_0MkH.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-Csj_0MkH.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,gBAAA,CAAiB,OAAA,EAAS,iBAAA,GAAiB,IAAA,CAAA,MAAA,QAAA,IAAA,CAAA,MAAA"}