Skip to content

Commit

Permalink
chore: ensure dir for script
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Sep 15, 2024
1 parent bacd3de commit e4f140c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ export function NuxtScriptBundleTransformer(options: AssetBundlerTransformerOpti
// less aggressive cache clearing in dev
if (!nuxt.options.dev) {
await fsp.rm(cacheDir, { recursive: true, force: true })
await fsp.mkdir(cacheDir, { recursive: true })
}
// ensure dir
await fsp.mkdir(cacheDir, { recursive: true })
await Promise.all(scripts.map(async ([url, content]) => {
if (content instanceof Error || !content.filename)
return
Expand Down

0 comments on commit e4f140c

Please sign in to comment.