generated from dishait/vite-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { posix } from "path"; | ||
import { getPackageInfo } from "local-pkg"; | ||
|
||
export const normalizePath = (path: string): string => { | ||
export function normalizePath(path: string) { | ||
path = path.startsWith("/") ? path : "/" + path; | ||
return posix.normalize(path); | ||
}; | ||
} | ||
|
||
export const isVite2 = async () => { | ||
export async function isVite2() { | ||
const info = await getPackageInfo("vite"); | ||
if (info) { | ||
return /.?2/.test(info.version); | ||
} | ||
return false; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters