Skip to content

Commit

Permalink
Update publicFolder.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lsegurado authored Nov 6, 2024
1 parent 5f05bcc commit f741458
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/config/plugins/publicFolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export const publicFolderPlugin: Plugin = {
setup(build) {
const outdir = build.initialOptions.outdir;
// Clean outdir
if (!outdir) return;

if (fs.existsSync(outdir)) fs.rmSync(outdir, { recursive: true });

if (!outdir)
return;
if (fs.existsSync(outdir))
fs.rmSync(outdir, { recursive: true });
fs.mkdirSync(outdir, { recursive: true });
if (!fs.existsSync(config.public.path))
return;

if (config.public.manifest?.options && config.public.manifest.name) {
const transformedFile = jsonTransformer.transformer(
Expand Down

0 comments on commit f741458

Please sign in to comment.