Skip to content

Commit

Permalink
fix: adjust the execution position of the remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre authored and haoziqaq committed Jul 16, 2021
1 parent a23de61 commit 7fc61de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/varlet-cli/src/commands/compile.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import ora from 'ora'
import { remove } from 'fs-extra'
import { ES_DIR, UMD_DIR } from '../shared/constant'
import { ES_DIR, HL_DIR, UMD_DIR } from '../shared/constant'
import { compileModule } from '../compiler/compileModule'
import { compileTemplateHighlight } from '../compiler/compileTemplateHighlight'
import { compileTypes } from '../compiler/compileTypes'

export function removeDir() {
return Promise.all([remove(ES_DIR), remove(UMD_DIR)])
return Promise.all([remove(ES_DIR), remove(HL_DIR), remove(UMD_DIR)])
}

export async function compile() {
Expand Down
3 changes: 1 addition & 2 deletions packages/varlet-cli/src/compiler/compileTemplateHighlight.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ensureDir, readdirSync, readFileSync, remove, writeFile } from 'fs-extra'
import { ensureDir, readdirSync, readFileSync, writeFile } from 'fs-extra'
import {
SRC_DIR,
HL_MD,
Expand Down Expand Up @@ -159,7 +159,6 @@ export function compileDir(
}

export async function compileTemplateHighlight() {
await remove(HL_DIR)
await ensureDir(HL_DIR)

const tags: Record<string, any> = {}
Expand Down

0 comments on commit 7fc61de

Please sign in to comment.