@icvdeveloper/common-module 0.0.14 → 0.0.15
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.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +16 -6
- package/package.json +1 -1
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { join, resolve } from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { defineNuxtModule, useLogger, installModule, addPlugin, addAutoImportDir, addComponentsDir } from '@nuxt/kit';
|
|
4
4
|
import svgLoader from 'vite-svg-loader';
|
|
@@ -22,10 +22,12 @@ const module = defineNuxtModule({
|
|
|
22
22
|
},
|
|
23
23
|
defaults: {
|
|
24
24
|
portalHash: null,
|
|
25
|
-
apiUrl: null
|
|
25
|
+
apiUrl: null,
|
|
26
|
+
tailwindConfigPath: null
|
|
26
27
|
},
|
|
27
28
|
async setup(options, nuxt) {
|
|
28
29
|
const logger = useLogger();
|
|
30
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
29
31
|
if (nuxt.options.ssr) {
|
|
30
32
|
throw new Error("V3plusCommonModule does not support SSR");
|
|
31
33
|
}
|
|
@@ -49,10 +51,19 @@ const module = defineNuxtModule({
|
|
|
49
51
|
}
|
|
50
52
|
if (!nuxt.options.modules.includes("@nuxtjs/tailwindcss")) {
|
|
51
53
|
logger.info("Installing TailwindCss");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const tailwindConfigPath = options.tailwindConfigPath;
|
|
55
|
+
const tailwindConfig = {};
|
|
56
|
+
if (tailwindConfig) {
|
|
57
|
+
tailwindConfig.configPath = tailwindConfigPath;
|
|
58
|
+
}
|
|
59
|
+
tailwindConfig.config = {
|
|
60
|
+
content: [join(runtimeDir, "components/**/*.{vue,js}")]
|
|
61
|
+
};
|
|
62
|
+
console.log(tailwindConfig);
|
|
63
|
+
await installModule("@nuxtjs/tailwindcss", tailwindConfig);
|
|
55
64
|
logger.success("Tailwindcss installed!");
|
|
65
|
+
} else {
|
|
66
|
+
throw new Error("Remove @nuxtjs/tailwindcss from nuxt.config.js");
|
|
56
67
|
}
|
|
57
68
|
logger.info("Installing SVG loader");
|
|
58
69
|
if (nuxt.options.vite.plugins) {
|
|
@@ -61,7 +72,6 @@ const module = defineNuxtModule({
|
|
|
61
72
|
nuxt.options.vite.plugins = [svgLoader()];
|
|
62
73
|
}
|
|
63
74
|
logger.success("SVG loader installed!");
|
|
64
|
-
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
65
75
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
66
76
|
addPlugin(resolve(runtimeDir, "plugin"));
|
|
67
77
|
nuxt.options.css.push("nprogress/nprogress.css");
|