minista 3.1.8 → 3.1.9

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.
@@ -4,7 +4,8 @@ import {
4
4
  defineConfig as defineViteConfig,
5
5
  mergeConfig as mergeViteConfig,
6
6
  searchForWorkspaceRoot,
7
- createLogger
7
+ createLogger,
8
+ normalizePath
8
9
  } from "vite";
9
10
  const __filename = fileURLToPath(import.meta.url);
10
11
  const __dirname = path.dirname(__filename);
@@ -12,20 +13,23 @@ function resolveViteAssetFileNames(chunkInfo, mainConfig) {
12
13
  const filePath = chunkInfo.name || "";
13
14
  const fileExt = path.extname(filePath);
14
15
  if (fileExt.match(/\.(jpg|jpeg|gif|png|webp|svg)/)) {
15
- return path.join(
16
- mainConfig.assets.images.outDir,
17
- mainConfig.assets.images.outName + ".[ext]"
16
+ return normalizePath(
17
+ path.join(
18
+ mainConfig.assets.images.outDir,
19
+ mainConfig.assets.images.outName + ".[ext]"
20
+ )
18
21
  );
19
22
  }
20
23
  if (fileExt.match(/\.(woff|woff2|eot|ttf|otf)/)) {
21
- return path.join(
22
- mainConfig.assets.fonts.outDir,
23
- mainConfig.assets.fonts.outName + ".[ext]"
24
+ return normalizePath(
25
+ path.join(
26
+ mainConfig.assets.fonts.outDir,
27
+ mainConfig.assets.fonts.outName + ".[ext]"
28
+ )
24
29
  );
25
30
  }
26
- return path.join(
27
- mainConfig.assets.outDir,
28
- mainConfig.assets.outName + ".[ext]"
31
+ return normalizePath(
32
+ path.join(mainConfig.assets.outDir, mainConfig.assets.outName + ".[ext]")
29
33
  );
30
34
  }
31
35
  async function resolveViteConfig(mainConfig, subConfig) {
@@ -1,6 +1,7 @@
1
1
  import path from "node:path";
2
2
  import fs from "fs-extra";
3
3
  import fg from "fast-glob";
4
+ import { normalizePath } from "vite";
4
5
  import { logger } from "../cli/logger.js";
5
6
  import { transformSprite } from "../transform/sprite.js";
6
7
  import { getSpace } from "../utility/space.js";
@@ -12,7 +13,7 @@ async function generateTempSprite({
12
13
  const { resolvedRoot } = config.sub;
13
14
  const options = config.main.assets.icons.svgstoreOptions;
14
15
  const filePath = fileName.replace(resolvedRoot, "");
15
- const svgFiles = await fg(path.join(srcDir, "**/*.svg"));
16
+ const svgFiles = await fg(normalizePath(path.join(srcDir, "**/*.svg")));
16
17
  if (!svgFiles.length) {
17
18
  return;
18
19
  }
@@ -41,7 +42,7 @@ async function generateSprites({
41
42
  createArray.map(async (item) => {
42
43
  const srcDir = item[0];
43
44
  const fileName = item[1];
44
- const svgFiles = await fg(path.join(srcDir, "**/*.svg"));
45
+ const svgFiles = await fg(normalizePath(path.join(srcDir, "**/*.svg")));
45
46
  if (!svgFiles.length) {
46
47
  return;
47
48
  }
@@ -1,5 +1,6 @@
1
1
  import path from "node:path";
2
2
  import fs from "fs-extra";
3
+ import { normalizePath } from "vite";
3
4
  import { syncTempSprite } from "../server/sprite.js";
4
5
  import { getElements, cleanElement } from "../utility/element.js";
5
6
  import { getUniquePaths } from "../utility/path.js";
@@ -62,7 +63,7 @@ async function transformIcons({
62
63
  const { el, srcDir, iconId } = item;
63
64
  const fileName = cacheData[srcDir];
64
65
  const hrefOptions = command === "serve" ? { remove: resolvedRoot } : { add: resolvedBase };
65
- const href = getIconHref(fileName, iconId, hrefOptions);
66
+ const href = normalizePath(getIconHref(fileName, iconId, hrefOptions));
66
67
  el.setAttribute("href", href);
67
68
  cleanElement(el, cleanAttributes);
68
69
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minista",
3
3
  "description": "Static site generator with 100% static export from React and Vite",
4
- "version": "3.1.8",
4
+ "version": "3.1.9",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=14.15.0"