Skip to content

Commit e3e2939

Browse files
committed
clean up
1 parent 01480ef commit e3e2939

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/core/src/vite-plugin-astro-icon.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import type { AstroConfig, AstroIntegrationLogger } from "astro";
2+
import { createHash } from "node:crypto";
3+
import {parse, resolve} from "node:path";
24
import { mkdir, readFile, writeFile } from "node:fs/promises";
35
import type { Plugin } from "vite";
46
import type {
@@ -8,8 +10,6 @@ import type {
810
} from "../typings/integration";
911
import loadLocalCollection from "./loaders/loadLocalCollection.js";
1012
import loadIconifyCollections from "./loaders/loadIconifyCollections.js";
11-
import { createHash } from "node:crypto";
12-
import Path from "node:path";
1313

1414
interface PluginContext extends Pick<AstroConfig, "root" | "output"> {
1515
logger: AstroIntegrationLogger;
@@ -51,8 +51,8 @@ export function createPlugin(
5151
configureServer({ watcher, moduleGraph }) {
5252
watcher.add(`${iconDir}/**/*.svg`);
5353
watcher.on("all", async (_, filepath: string) => {
54-
const parsedPath = Path.parse(filepath);
55-
const resolvedIconDir = Path.resolve(root.pathname, iconDir);
54+
const parsedPath = parse(filepath);
55+
const resolvedIconDir = resolve(root.pathname, iconDir);
5656
const isSvgFileInIconDir =
5757
parsedPath.dir.startsWith(resolvedIconDir) &&
5858
parsedPath.ext === ".svg";

0 commit comments

Comments
 (0)