@@ -48,7 +48,7 @@ export async function packIndividually() {
48
48
49
49
// get a list of every function bundle
50
50
const buildResults = this . buildResults ;
51
- const bundlePathList = buildResults . map ( b => b . bundlePath ) ;
51
+ const bundlePathList = buildResults . map ( b => path . dirname ( b . bundlePath ) ) ;
52
52
53
53
// get a list of external dependencies already listed in package.json
54
54
const externals = without < string > ( this . buildOptions . exclude , this . buildOptions . external ) ;
@@ -63,9 +63,9 @@ export async function packIndividually() {
63
63
const startZip = Date . now ( ) ;
64
64
const name = func . name ;
65
65
66
- const excludedFiles = [
66
+ const excludedFilesOrDirectory = [
67
67
...excludedFilesDefault ,
68
- ...bundlePathList . filter ( p => p !== bundlePath ) ,
68
+ ...bundlePathList . filter ( p => ! bundlePath . startsWith ( p ) ) ,
69
69
] ;
70
70
71
71
// allowed external dependencies in the final zip
@@ -89,8 +89,8 @@ export async function packIndividually() {
89
89
zip . pipe ( output ) ;
90
90
91
91
files . forEach ( ( filePath : string ) => {
92
- // exclude non individual files
93
- if ( excludedFiles . includes ( filePath ) ) return ;
92
+ // exclude non individual files based on file or dir path
93
+ if ( excludedFilesOrDirectory . find ( p => filePath . startsWith ( p ) ) ) return ;
94
94
95
95
// exclude generated zip TODO:better logic
96
96
if ( filePath . endsWith ( '.zip' ) ) return ;
0 commit comments