Skip to content

Commit

Permalink
fix: check static path exists before copying files
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 1, 2020
1 parent 19fac74 commit 9f1bdc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const compositionApiModule: Module<any> = function () {
})

this.nuxt.hook('generate:done', async (generator: any) => {
if (!existsSync(staticPath)) return

const { distPath } = generator
readdirSync(staticPath).forEach(file =>
copyFileSync(join(staticPath, file), join(distPath, file))
Expand Down

0 comments on commit 9f1bdc7

Please sign in to comment.