@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 CHANGED
@@ -3,6 +3,7 @@ import * as _nuxt_schema from '@nuxt/schema';
3
3
  interface ModuleOptions {
4
4
  portalHash?: null | string;
5
5
  apiUrl?: null | string;
6
+ tailwindConfigPath?: null | string;
6
7
  }
7
8
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
8
9
 
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.0.14"
7
+ "version": "0.0.15"
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { resolve, join } from 'path';
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
- await installModule("@nuxtjs/tailwindcss", {
53
- configPath: "../tailwind.config.cjs"
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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {