Skip to content

Commit

Permalink
Merge pull request #10 from beforeyoubid/defect/rm-dir
Browse files Browse the repository at this point in the history
Defect/rm dir
  • Loading branch information
alice-byb authored Apr 18, 2023
2 parents 64cb219 + ca00794 commit 026c1ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "serverless-esbuild-layers",
"version": "0.1.4",
"version": "0.1.5",
"author": {
"name": "Bailey Sheather",
"email": "[email protected]",
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ class EsbuildLayersPlugin implements Plugin {
.map((p: string) => p.replace(/^!/, '')) ??
[];
this.log.info(`Cleaning ${exclude.map(rule => path.join(nodeLayerPath, rule)).join(', ')}`);
const filesDeleted = await del(exclude.map(rule => path.join(nodeLayerPath, rule)));
let filesDeleted: string[] = [];
try {
filesDeleted = await del(exclude.map(rule => path.join(nodeLayerPath, rule)));
} catch (_err) {}
if (fs.existsSync(nodeLayerPath) && minify) {
await minifyAll(nodeLayerPath, {
compress_json: true,
Expand Down

0 comments on commit 026c1ab

Please sign in to comment.