@vueless/nuxt 0.0.9-beta.20 → 0.0.9-beta.22

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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.13.0"
6
6
  },
7
- "version": "0.0.9-beta.20",
7
+ "version": "0.0.9-beta.22",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -29,8 +29,10 @@ const module = defineNuxtModule({
29
29
  debug: false
30
30
  },
31
31
  async setup(_options, _nuxt) {
32
- const { resolve } = createResolver(import.meta.url);
33
32
  const { mirrorCacheDir, debug } = _options;
33
+ const { resolve } = createResolver(import.meta.url);
34
+ const { vuelessConfig, dependencies } = await getVuelessConfig();
35
+ _nuxt.options.runtimeConfig.public.vueless = vuelessConfig;
34
36
  _nuxt.options.build.transpile.push("vueless");
35
37
  _nuxt.hook("vite:extendConfig", async (config) => {
36
38
  config.plugins = config.plugins || [];
@@ -39,7 +41,17 @@ const module = defineNuxtModule({
39
41
  Vueless({ mode: "nuxt-module", mirrorCacheDir, debug })
40
42
  );
41
43
  });
42
- _nuxt.options.runtimeConfig.public.vueless = await getVuelessConfig();
44
+ if (_nuxt.options.dev) {
45
+ const chokidarPath = require.resolve("chokidar");
46
+ const chokidar = await import(chokidarPath);
47
+ const watcher = chokidar.watch(dependencies, { ignoreInitial: true });
48
+ watcher.on("change", async () => {
49
+ const { dependencies: newDependencies } = await getVuelessConfig();
50
+ watcher.unwatch(dependencies);
51
+ watcher.add(newDependencies);
52
+ _nuxt.callHook("restart");
53
+ });
54
+ }
43
55
  await createTailwindSafelist({
44
56
  targetFiles: getNuxtDirs()
45
57
  });
@@ -63,7 +75,9 @@ async function getVuelessConfig() {
63
75
  format: "esm",
64
76
  target: "ESNext",
65
77
  loader: { ".ts": "ts" },
66
- write: false
78
+ write: false,
79
+ metafile: true
80
+ // Generate dependency tree
67
81
  };
68
82
  const configPathJs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.js`);
69
83
  const configPathTs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.ts`);
@@ -75,7 +89,10 @@ async function getVuelessConfig() {
75
89
  result = await esbuild.build({ ...esbuildConfig, entryPoints: [configPathTs] });
76
90
  }
77
91
  const code = result?.outputFiles?.[0]?.text || "";
78
- return (await import(`data:text/javascript,${encodeURIComponent(code)}`)).default || {};
92
+ return {
93
+ vuelessConfig: (await import(`data:text/javascript,${encodeURIComponent(code)}`)).default || {},
94
+ dependencies: Object.keys(result?.metafile?.inputs || {})
95
+ };
79
96
  }
80
97
 
81
98
  export { module as default };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/nuxt",
3
- "version": "0.0.9-beta.20",
3
+ "version": "0.0.9-beta.22",
4
4
  "license": "MIT",
5
5
  "description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  "@nuxt/kit": "^3.13.1",
59
59
  "@tailwindcss/vite": "^4.0.14",
60
60
  "tailwindcss": "^4.0.14",
61
- "vueless": "^0.0.825-beta.60"
61
+ "vueless": "^0.0.825-beta.65"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@material-symbols/svg-500": "^0.29.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vueless/nuxt",
3
- "version": "0.0.9-beta.20",
3
+ "version": "0.0.9-beta.22",
4
4
  "license": "MIT",
5
5
  "description": "Nuxt Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  "@nuxt/kit": "^3.13.1",
59
59
  "@tailwindcss/vite": "^4.0.14",
60
60
  "tailwindcss": "^4.0.14",
61
- "vueless": "^0.0.825-beta.60"
61
+ "vueless": "^0.0.825-beta.65"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@material-symbols/svg-500": "^0.29.1",