Skip to content

Commit

Permalink
Added confirmation of directory existence
Browse files Browse the repository at this point in the history
  • Loading branch information
qrac committed May 9, 2022
1 parent e268cf4 commit 277522f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "minista",
"description": "Next.js Like Development with 100% Static Generate",
"version": "2.4.0",
"version": "2.4.1",
"bin": {
"minista": "./bin/minista.js"
},
Expand Down
9 changes: 9 additions & 0 deletions src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { UserConfig as ViteConfig, InlineConfig } from "vite"
import type { Options as MdxOptions } from "@mdx-js/esbuild"

import fs from "fs-extra"
import path from "path"
import url from "url"

Expand Down Expand Up @@ -114,6 +115,14 @@ export async function generatePartialHydration(
viteConfig: InlineConfig
) {
const moduleDir = systemConfig.temp.partialHydration.outDir + "/modules"

const moduleDirRelative = path.relative(".", moduleDir)
const moduleDirExists = fs.existsSync(moduleDirRelative)

if (!moduleDirExists) {
return
}

const moduleFilePaths = await getFilePaths(moduleDir, "txt")

if (moduleFilePaths.length === 0) {
Expand Down

0 comments on commit 277522f

Please sign in to comment.