@vixt/core 0.6.6 → 0.6.8

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.
@@ -24,8 +24,10 @@ interface PluginDefinition {
24
24
  }
25
25
  interface VixtPlugin {
26
26
  (this: void, vixt: VixtApp): any;
27
+ /** @internal */
28
+ _name?: string;
27
29
  }
28
30
  declare function defineVixtPlugin(definition: PluginDefinition | VixtPlugin): VixtPlugin;
29
- declare function applyPlugins(vixt: VixtApp, plugins: VixtPlugin[]): Promise<void>;
31
+ declare function applyPlugins(vixt: VixtApp, plugins: VixtPlugin[]): void;
30
32
  //#endregion
31
33
  export { CreateOptions, PluginDefinition, VixtApp, VixtAppConfig, VixtPlugin, applyPlugins, createVixtApp, defineAppConfig, defineVixtPlugin, useAppConfig, useVixtApp };
@@ -17,11 +17,13 @@ function createVixtApp(options) {
17
17
  //#endregion
18
18
  //#region src/client/plugin.ts
19
19
  function defineVixtPlugin(definition) {
20
- if (typeof definition == "function") return defineVixtPlugin({ setup: definition });
21
- return (vixt) => definition.setup?.(vixt);
20
+ if (typeof definition == "function") return definition;
21
+ const pluginName = definition.name;
22
+ const pluginSetup = definition.setup || (() => {});
23
+ return Object.assign(pluginSetup, { _name: pluginName });
22
24
  }
23
- async function applyPlugins(vixt, plugins) {
24
- for (const plugin of plugins) typeof plugin === "function" && await plugin(vixt);
25
+ function applyPlugins(vixt, plugins) {
26
+ for (const plugin of plugins) typeof plugin === "function" && plugin(vixt);
25
27
  }
26
28
 
27
29
  //#endregion
@@ -585,6 +585,12 @@ var vite_default = defineVixtModule({
585
585
  base: app?.baseURL,
586
586
  define: defineEnv
587
587
  });
588
+ },
589
+ configResolved(config) {
590
+ Object.assign(config.env, {
591
+ ...env$1,
592
+ ...config.env
593
+ });
588
594
  }
589
595
  };
590
596
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.6.6",
4
+ "version": "0.6.8",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://soullyoko.github.io/vixt/",