Skip to content

Commit

Permalink
fix: remove ! from exclusion pattern list for proper matching (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstackhouse committed Jan 26, 2023
1 parent 16e95cb commit 8073a20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ export async function pack(this: EsbuildServerlessPlugin) {

assert(func.package?.patterns);

const functionExclusionPatterns = func.package.patterns.filter((pattern) => pattern.charAt(0) === '!');
const functionExclusionPatterns = func.package.patterns
.filter((pattern) => pattern.charAt(0) === '!')
.map((pattern) => pattern.slice(1));

const functionFiles = await globby(func.package.patterns, { cwd: buildDirPath });
const functionExcludedFiles = (await globby(functionExclusionPatterns, { cwd: buildDirPath })).map(trimExtension);
Expand Down

0 comments on commit 8073a20

Please sign in to comment.