vuetify-nuxt-module 0.5.5 → 0.5.7

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
@@ -195,6 +195,12 @@ interface MOptions {
195
195
  styles?: true | 'none' | 'expose' | 'sass' | {
196
196
  configFile: string;
197
197
  };
198
+ /**
199
+ * Add Vuetify Vite Plugin `transformAssetsUrls`?
200
+ *
201
+ * @default false
202
+ */
203
+ includeTransformAssetsUrls?: boolean;
198
204
  }
199
205
  interface ModuleOptions {
200
206
  moduleOptions?: MOptions;
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.5.5"
7
+ "version": "0.5.7"
8
8
  }
package/dist/module.mjs CHANGED
@@ -7,10 +7,11 @@ import { createConfigLoader } from 'unconfig';
7
7
  import { readFile, utimes } from 'node:fs/promises';
8
8
  import { isPackageExists } from 'local-pkg';
9
9
  import { resolveVuetifyBase, normalizePath, writeStyles, cacheDir } from '@vuetify/loader-shared';
10
+ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
10
11
  import { isAbsolute, join, relative } from 'pathe';
11
12
  import { normalizePath as normalizePath$1 } from 'vite';
12
13
 
13
- const version = "0.5.5";
14
+ const version = "0.5.7";
14
15
 
15
16
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
16
17
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -362,7 +363,7 @@ async function load(options, nuxt, ctx) {
362
363
  ctx.dateAdapter = adapter;
363
364
  } else {
364
365
  if (date.find((d) => d === adapter) === void 0)
365
- ctx.logger.warn(`Ignoring Vuetify Date configuration, date adapter "@date-io/${adapter}" not installed!`);
366
+ ctx.logger.warn(`[vuetify-nuxt-module] Ignoring Vuetify Date configuration, date adapter "@date-io/${adapter}" not installed!`);
366
367
  else
367
368
  ctx.dateAdapter = adapter;
368
369
  }
@@ -1004,6 +1005,7 @@ function configureVite(configKey, nuxt, ctx) {
1004
1005
  ...Array.isArray(viteInlineConfig.ssr.noExternal) ? viteInlineConfig.ssr.noExternal : [],
1005
1006
  configKey
1006
1007
  ];
1008
+ viteInlineConfig.plugins.push(vuetify({ styles: true, autoImport: true }));
1007
1009
  viteInlineConfig.plugins.push(vuetifyStylesPlugin({ styles: ctx.moduleOptions.styles }, ctx.logger));
1008
1010
  viteInlineConfig.plugins.push(vuetifyConfigurationPlugin(ctx));
1009
1011
  viteInlineConfig.plugins.push(vuetifyIconsPlugin(ctx));
@@ -1021,8 +1023,13 @@ function toKebabCase(str = "") {
1021
1023
  toKebabCase.cache = /* @__PURE__ */ new Map();
1022
1024
 
1023
1025
  function configureNuxt(configKey, nuxt, ctx) {
1024
- var _a;
1025
- const { importComposables, prefixComposables, styles } = ctx.moduleOptions;
1026
+ var _a, _b, _c;
1027
+ const {
1028
+ importComposables,
1029
+ prefixComposables,
1030
+ styles,
1031
+ includeTransformAssetsUrls = false
1032
+ } = ctx.moduleOptions;
1026
1033
  const runtimeDir = ctx.resolver.resolve("./runtime");
1027
1034
  nuxt.options.build.transpile.push(configKey);
1028
1035
  nuxt.options.build.transpile.push(runtimeDir);
@@ -1033,6 +1040,14 @@ function configureNuxt(configKey, nuxt, ctx) {
1033
1040
  nuxt.options.css.unshift("vuetify/styles");
1034
1041
  else if (typeof styles === "object" && typeof styles?.configFile === "string")
1035
1042
  nuxt.options.css.unshift(styles.configFile);
1043
+ if (includeTransformAssetsUrls) {
1044
+ (_b = nuxt.options.vite).vue ?? (_b.vue = {});
1045
+ (_c = nuxt.options.vite.vue).template ?? (_c.template = {});
1046
+ if (typeof nuxt.options.vite.vue.template.transformAssetUrls === "undefined")
1047
+ nuxt.options.vite.vue.template.transformAssetUrls = transformAssetUrls;
1048
+ else
1049
+ ctx.logger.warn("[vuetify-nuxt-module] `includeTransformAssetsUrls` is enabled but `vite.vue.template.transformAssetUrls` is already configured, ignored!");
1050
+ }
1036
1051
  extendWebpackConfig(() => {
1037
1052
  throw new Error("Webpack is not supported: vuetify-nuxt-module module can only be used with Vite!");
1038
1053
  });
@@ -1041,23 +1056,6 @@ function configureNuxt(configKey, nuxt, ctx) {
1041
1056
  references.push({ types: "vuetify-nuxt-module/custom-configuration" });
1042
1057
  references.push({ types: "vuetify-nuxt-module/configuration" });
1043
1058
  });
1044
- nuxt.hook("components:extend", async (c) => {
1045
- const components = await ctx.componentsPromise;
1046
- Object.keys(components).forEach((component) => {
1047
- c.push({
1048
- pascalName: component,
1049
- kebabName: toKebabCase(component),
1050
- export: component,
1051
- filePath: "vuetify/components",
1052
- shortPath: "vuetify/components",
1053
- chunkName: toKebabCase(component),
1054
- prefetch: false,
1055
- preload: false,
1056
- global: false,
1057
- mode: "all"
1058
- });
1059
- });
1060
- });
1061
1059
  if (importComposables) {
1062
1060
  const composables = ["useLocale", "useDefaults", "useDisplay", "useLayout", "useRtl", "useTheme"];
1063
1061
  addImports(composables.map((name) => ({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.5.5",
4
+ "version": "0.5.7",
5
5
  "packageManager": "pnpm@8.6.10",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
@@ -128,4 +128,4 @@
128
128
  "installDependencies": false,
129
129
  "startCommand": "node .stackblitz.js && pnpm install && pnpm run dev"
130
130
  }
131
- }
131
+ }