Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/core/src/htmlPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,17 @@ export function createPlugin(userOptions: UserOptions = {}): PluginOption {
)
await Promise.all(
htmlDirs.map(async (item) => {
const isEmpty = await isDirEmpty(item)
if (isEmpty) {
return fs.remove(item)
let dir = item
while (dir != cwd) {
const isExists = await fs.exists(dir)
if (!isExists) {
return
}
const isEmpty = await isDirEmpty(item)
if (isEmpty) {
await fs.remove(item)
}
dir = path.resolve(dir, '..')
}
}),
)
Expand Down