Skip to content

Commit

Permalink
ensure dir for dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Oct 1, 2021
1 parent 9e8b10d commit b1f7d2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ export async function runBuild(rootDir: string, isDev: boolean, generateApi: boo
}

async function createRootPackage(opts: BuildOptions) {
await emptyDir(opts.distDir);
await emptyDir(opts.distTestsDir);
if (opts.isDev) {
await emptyDir(opts.distDir);
await emptyDir(opts.distTestsDir);
} else {
await ensureDir(opts.distDir);
await ensureDir(opts.distTestsDir);
}

await ensureDir(opts.distIntegrationDir);
await ensureDir(opts.distLibDir);
Expand Down
4 changes: 2 additions & 2 deletions scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export function fileSize(): Plugin {
if (!filePath.includes('debug')) {
const s = statSync(filePath);
const gzip = gzipSize.sync(readFileSync(filePath, 'utf-8'));
console.log(`👽 ${basename(filePath)}: ${s.size} b`);
console.log(`👾 ${basename(filePath)}: ${gzip} b (gzip)`);
console.log(`🕺 ${basename(filePath)}: ${s.size} b`);
console.log(`🎉 ${basename(filePath)}: ${gzip} b (gzip)`);
}
},
};
Expand Down

1 comment on commit b1f7d2b

@vercel
Copy link

@vercel vercel bot commented on b1f7d2b Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.