@vixt/vue 0.1.21 → 0.1.23

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 (2) hide show
  1. package/dist/index.mjs +9 -8
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -26,7 +26,7 @@ function genarateAppComponent(vixt) {
26
26
  }
27
27
 
28
28
  function generateAppConfig(vixt) {
29
- const { buildImportsDir, srcDir, srcDirName } = vixt.options;
29
+ const { buildImportsDir, srcDirName } = vixt.options;
30
30
  let appConfigsImportTemplate = "";
31
31
  let appConfigsMergeTemplate = "";
32
32
  let i = 0;
@@ -40,18 +40,19 @@ function generateAppConfig(vixt) {
40
40
  i++;
41
41
  }
42
42
  }
43
+ const globalAppConfigKey = "__VIXT_APP_CONFIG";
43
44
  const appConfigTemplate = `
44
45
  import { defu } from 'defu'
45
46
  ${appConfigsImportTemplate}
46
47
  const appConfig = defu(${appConfigsMergeTemplate}{})
47
- function useAppConfig() {
48
- return appConfig
49
- }
50
- export { useAppConfig }
48
+ globalThis.${globalAppConfigKey} = appConfig
51
49
  `;
52
- const mainTsPath = path.resolve(srcDir, "main.ts");
53
- fs.outputFileSync(path.resolve(buildImportsDir, `app.config.ts`), `// @ts-nocheck
54
- export { useAppConfig } from '${mainTsPath}'`);
50
+ fs.outputFileSync(path.resolve(buildImportsDir, `app.config.ts`), `// Generated by Vixt
51
+ // @ts-nocheck
52
+ import type { VixtAppConfig } from '@vixt/core/client'
53
+
54
+ export const useAppConfig = () => globalThis.${globalAppConfigKey} as VixtAppConfig
55
+ `);
55
56
  return appConfigTemplate;
56
57
  }
57
58
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/vue",
3
3
  "type": "module",
4
- "version": "0.1.21",
4
+ "version": "0.1.23",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/SoulLyoko/vixt#readme",
@@ -22,16 +22,16 @@
22
22
  "@vitejs/plugin-vue-jsx": "^4.0.1",
23
23
  "@vueuse/core": "^11.1.0",
24
24
  "pinia": "^2.2.4",
25
- "pinia-plugin-persistedstate": "^4.1.1",
26
- "unocss": "^0.63.4",
25
+ "pinia-plugin-persistedstate": "^4.1.2",
26
+ "unocss": "^0.63.6",
27
27
  "unplugin-auto-import": "^0.18.3",
28
28
  "unplugin-vue-components": "^0.27.4",
29
29
  "unplugin-vue-router": "^0.10.8",
30
- "vite-plugin-vue-devtools": "^7.5.2",
30
+ "vite-plugin-vue-devtools": "^7.5.4",
31
31
  "vite-plugin-vue-layouts": "^0.11.0",
32
32
  "vue": "^3.5.12",
33
33
  "vue-router": "^4.4.5",
34
- "@vixt/core": "0.1.21"
34
+ "@vixt/core": "0.1.23"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "unbuild"