@vueless/nuxt 0.0.9-beta.20 → 0.0.9-beta.21
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 +1 -1
- package/dist/module.mjs +19 -4
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/dist/module.json
CHANGED
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,15 @@ const module = defineNuxtModule({
|
|
|
39
41
|
Vueless({ mode: "nuxt-module", mirrorCacheDir, debug })
|
|
40
42
|
);
|
|
41
43
|
});
|
|
42
|
-
|
|
44
|
+
const chokidarPath = require.resolve("chokidar");
|
|
45
|
+
const chokidar = await import(chokidarPath);
|
|
46
|
+
const watcher = chokidar.watch(dependencies, { ignoreInitial: true });
|
|
47
|
+
watcher.on("change", async () => {
|
|
48
|
+
const { dependencies: newDependencies } = await getVuelessConfig();
|
|
49
|
+
watcher.unwatch(dependencies);
|
|
50
|
+
watcher.add(newDependencies);
|
|
51
|
+
_nuxt.callHook("restart");
|
|
52
|
+
});
|
|
43
53
|
await createTailwindSafelist({
|
|
44
54
|
targetFiles: getNuxtDirs()
|
|
45
55
|
});
|
|
@@ -63,7 +73,9 @@ async function getVuelessConfig() {
|
|
|
63
73
|
format: "esm",
|
|
64
74
|
target: "ESNext",
|
|
65
75
|
loader: { ".ts": "ts" },
|
|
66
|
-
write: false
|
|
76
|
+
write: false,
|
|
77
|
+
metafile: true
|
|
78
|
+
// Generate dependency tree
|
|
67
79
|
};
|
|
68
80
|
const configPathJs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.js`);
|
|
69
81
|
const configPathTs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.ts`);
|
|
@@ -75,7 +87,10 @@ async function getVuelessConfig() {
|
|
|
75
87
|
result = await esbuild.build({ ...esbuildConfig, entryPoints: [configPathTs] });
|
|
76
88
|
}
|
|
77
89
|
const code = result?.outputFiles?.[0]?.text || "";
|
|
78
|
-
return
|
|
90
|
+
return {
|
|
91
|
+
vuelessConfig: (await import(`data:text/javascript,${encodeURIComponent(code)}`)).default || {},
|
|
92
|
+
dependencies: Object.keys(result?.metafile?.inputs || {})
|
|
93
|
+
};
|
|
79
94
|
}
|
|
80
95
|
|
|
81
96
|
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.
|
|
3
|
+
"version": "0.0.9-beta.21",
|
|
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.
|
|
61
|
+
"vueless": "^0.0.825-beta.61"
|
|
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.
|
|
3
|
+
"version": "0.0.9-beta.21",
|
|
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.
|
|
61
|
+
"vueless": "^0.0.825-beta.61"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@material-symbols/svg-500": "^0.29.1",
|