Skip to content

Commit 714ace4

Browse files
authored
Merge pull request #84 from netlify/sw-yx-patch-1
Proposal: add warning if no function files found
2 parents 1d541c9 + e90a7db commit 714ace4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/build.js

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ function webpackConfig(dir, additionalConfig) {
8282
webpackConfig.entry[name] = "./" + file;
8383
}
8484
});
85+
if (Object.keys(webpackConfig.entry) < 1) {
86+
console.warn(
87+
`
88+
---Start netlify-lambda notification---
89+
WARNING: No valid single functions files (ending in .mjs, .js or .ts) were found.
90+
This could be because you have nested them in a folder.
91+
If this is expected (e.g. you have a zipped function built somewhere else), you may ignore this.
92+
---End netlify-lambda notification---
93+
`
94+
);
95+
}
8596
if (additionalConfig) {
8697
var webpackAdditional = require(path.join(process.cwd(), additionalConfig));
8798

0 commit comments

Comments
 (0)