@hostlink/nuxt-light 1.10.8 → 1.10.10

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.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.10.8"
4
+ "version": "1.10.10"
5
5
  }
package/dist/module.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { dirname } from 'node:path';
2
- import { defineNuxtModule, createResolver, resolvePath, addComponentsDir, addImports, addVitePlugin, resolveFiles, addPlugin } from '@nuxt/kit';
3
- import { quasar } from '@quasar/vite-plugin';
2
+ import { defineNuxtModule, createResolver, resolvePath, addVitePlugin, addComponentsDir, addImports, resolveFiles, addPlugin } from '@nuxt/kit';
4
3
  import { readFile } from 'node:fs/promises';
4
+ import { quasar } from '@quasar/vite-plugin';
5
5
 
6
6
  const module = defineNuxtModule({
7
7
  meta: {
@@ -24,6 +24,7 @@ const module = defineNuxtModule({
24
24
  rel: "stylesheet",
25
25
  href: "https://fonts.googleapis.com/css2?family=Noto+Sans&family=Noto+Sans+HK&family=Noto+Sans+TC&family=Material+Symbols+Outlined"
26
26
  });
27
+ addVitePlugin(quasar());
27
28
  await addComponentsDir({
28
29
  path: resolver.resolve("./runtime/components")
29
30
  });
@@ -61,7 +62,6 @@ const module = defineNuxtModule({
61
62
  { name: "LightModelField", from, type: true },
62
63
  { name: "LightModel", from, type: true }
63
64
  ]);
64
- addVitePlugin(quasar());
65
65
  const files = await resolveFiles(process.cwd() + "/models", ["*"]);
66
66
  nuxt.options.runtimeConfig.public.light = {
67
67
  model: []
@@ -82,6 +82,13 @@ const module = defineNuxtModule({
82
82
  config.optimizeDeps ??= {};
83
83
  config.optimizeDeps.exclude ??= [];
84
84
  config.optimizeDeps.exclude.push("quasar");
85
+ config.plugins ??= [];
86
+ config.plugins.push(
87
+ virtualQuasarEntryPlugin({
88
+ resolveQuasar,
89
+ dev: nuxt.options.dev
90
+ })
91
+ );
85
92
  config.define = {
86
93
  ...config.define,
87
94
  __QUASAR_VERSION__: `'${quasarVersion}'`,
@@ -106,5 +113,27 @@ const module = defineNuxtModule({
106
113
  });
107
114
  }
108
115
  });
116
+ function virtualQuasarEntryPlugin(context) {
117
+ const { resolveQuasar } = context;
118
+ const QUASAR_ENTRY = "quasar";
119
+ const QUASAR_VIRTUAL_ENTRY = "/__quasar/entry.mjs";
120
+ const clientEntry = resolveQuasar("dist/quasar.client.js");
121
+ return {
122
+ name: "quasar:entry",
123
+ enforce: "pre",
124
+ resolveId(id) {
125
+ if (id === QUASAR_ENTRY) {
126
+ return {
127
+ id: clientEntry,
128
+ moduleSideEffects: false
129
+ };
130
+ }
131
+ },
132
+ async load(id) {
133
+ if (!context.dev && id === QUASAR_VIRTUAL_ENTRY)
134
+ return Object.entries(context.imports.raw).filter(([, path]) => !path.includes("/__tests__/")).map(([name, path]) => `export { default as ${name} } from "quasar/${path}"`).join("\n");
135
+ }
136
+ };
137
+ }
109
138
 
110
139
  export { module as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.10.8",
3
+ "version": "1.10.10",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": "@hostlink/nuxt-light",
6
6
  "license": "MIT",