vuetify-nuxt-module 0.18.4 → 0.18.5
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 +29 -9
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { transformAssetUrls } from 'vite-plugin-vuetify';
|
|
|
16
16
|
import { parseQuery, parseURL } from 'ufo';
|
|
17
17
|
import destr from 'destr';
|
|
18
18
|
|
|
19
|
-
const version = "0.18.
|
|
19
|
+
const version = "0.18.5";
|
|
20
20
|
|
|
21
21
|
const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
|
|
22
22
|
const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `\0${VIRTUAL_VUETIFY_CONFIGURATION}`;
|
|
@@ -536,6 +536,7 @@ function vuetifyStylesPlugin(options, [major, minor, patch], _logger) {
|
|
|
536
536
|
let fileImport = false;
|
|
537
537
|
const PREFIX = "vuetify-styles/";
|
|
538
538
|
const SSR_PREFIX = `/@${PREFIX}`;
|
|
539
|
+
const resolveCss = resolveCssFactory();
|
|
539
540
|
return {
|
|
540
541
|
name: "vuetify:styles:nuxt",
|
|
541
542
|
enforce: "pre",
|
|
@@ -556,20 +557,18 @@ function vuetifyStylesPlugin(options, [major, minor, patch], _logger) {
|
|
|
556
557
|
},
|
|
557
558
|
async resolveId(source, importer, { custom, ssr }) {
|
|
558
559
|
if (source.startsWith(PREFIX) || source.startsWith(SSR_PREFIX)) {
|
|
559
|
-
if (source.
|
|
560
|
+
if (source.match(/\.s[ca]ss$/))
|
|
560
561
|
return source;
|
|
561
562
|
const idx = source.indexOf("?");
|
|
562
563
|
return idx > -1 ? source.slice(0, idx) : source;
|
|
563
564
|
}
|
|
564
565
|
if (source === "vuetify/styles" || importer && source.endsWith(".css") && isSubdir(vuetifyBase, path.isAbsolute(source) ? source : importer)) {
|
|
565
|
-
if (options.styles === "sass")
|
|
566
|
-
|
|
567
|
-
return this.resolve(target2, importer, { skipSelf: true, custom });
|
|
568
|
-
}
|
|
566
|
+
if (options.styles === "sass")
|
|
567
|
+
return this.resolve(resolveCss(source), importer, { skipSelf: true, custom });
|
|
569
568
|
const resolution = await this.resolve(source, importer, { skipSelf: true, custom });
|
|
570
569
|
if (!resolution)
|
|
571
570
|
return void 0;
|
|
572
|
-
const target = resolution.id
|
|
571
|
+
const target = resolveCss(resolution.id);
|
|
573
572
|
if (isNone) {
|
|
574
573
|
noneFiles.add(target);
|
|
575
574
|
return target;
|
|
@@ -582,9 +581,9 @@ function vuetifyStylesPlugin(options, [major, minor, patch], _logger) {
|
|
|
582
581
|
if (sassVariables) {
|
|
583
582
|
const target = id.startsWith(PREFIX) ? path.resolve(vuetifyBase, id.slice(PREFIX.length)) : id.startsWith(SSR_PREFIX) ? path.resolve(vuetifyBase, id.slice(SSR_PREFIX.length)) : void 0;
|
|
584
583
|
if (target) {
|
|
584
|
+
const suffix = target.match(/\.scss/) ? ";\n" : "\n";
|
|
585
585
|
return {
|
|
586
|
-
code: `@use "${configFile}"
|
|
587
|
-
@use "${fileImport ? pathToFileURL(target).href : normalizePath(target)}"`,
|
|
586
|
+
code: `@use "${configFile}"${suffix}@use "${fileImport ? pathToFileURL(target).href : normalizePath(target)}"${suffix}`,
|
|
588
587
|
map: {
|
|
589
588
|
mappings: ""
|
|
590
589
|
}
|
|
@@ -595,6 +594,23 @@ function vuetifyStylesPlugin(options, [major, minor, patch], _logger) {
|
|
|
595
594
|
}
|
|
596
595
|
};
|
|
597
596
|
}
|
|
597
|
+
function resolveCssFactory() {
|
|
598
|
+
const mappings = /* @__PURE__ */ new Map();
|
|
599
|
+
return (source) => {
|
|
600
|
+
let mapping = mappings.get(source);
|
|
601
|
+
if (!mapping) {
|
|
602
|
+
try {
|
|
603
|
+
mapping = source.replace(/\.css$/, ".sass");
|
|
604
|
+
if (!existsSync(mapping))
|
|
605
|
+
mapping = source.replace(/\.css$/, ".scss");
|
|
606
|
+
} catch {
|
|
607
|
+
mapping = source.replace(/\.css$/, ".scss");
|
|
608
|
+
}
|
|
609
|
+
mappings.set(source, mapping);
|
|
610
|
+
}
|
|
611
|
+
return mapping;
|
|
612
|
+
};
|
|
613
|
+
}
|
|
598
614
|
function isSubdir(root, test) {
|
|
599
615
|
const relative = relative$1(root, test);
|
|
600
616
|
return relative && !relative.startsWith("..") && !isAbsolute(relative);
|
|
@@ -1249,11 +1265,15 @@ function configureVite(configKey, nuxt, ctx) {
|
|
|
1249
1265
|
viteInlineConfig.css.preprocessorOptions ??= {};
|
|
1250
1266
|
viteInlineConfig.css.preprocessorOptions.sass ??= {};
|
|
1251
1267
|
viteInlineConfig.css.preprocessorOptions.sass.api = "modern-compiler";
|
|
1268
|
+
viteInlineConfig.css.preprocessorOptions.scss ??= {};
|
|
1269
|
+
viteInlineConfig.css.preprocessorOptions.scss.api = "modern-compiler";
|
|
1252
1270
|
} else {
|
|
1253
1271
|
viteInlineConfig.css ??= {};
|
|
1254
1272
|
viteInlineConfig.css.preprocessorOptions ??= {};
|
|
1255
1273
|
viteInlineConfig.css.preprocessorOptions.sass ??= {};
|
|
1256
1274
|
viteInlineConfig.css.preprocessorOptions.sass.api = "modern";
|
|
1275
|
+
viteInlineConfig.css.preprocessorOptions.scss ??= {};
|
|
1276
|
+
viteInlineConfig.css.preprocessorOptions.scss.api = "modern";
|
|
1257
1277
|
if (!("preprocessorMaxWorkers" in viteInlineConfig.css))
|
|
1258
1278
|
viteInlineConfig.css.preprocessorMaxWorkers = true;
|
|
1259
1279
|
}
|