Skip to content

Commit

Permalink
Merge pull request #84 from netlify/sw-yx-patch-1
Browse files Browse the repository at this point in the history
Proposal: add warning if no function files found
  • Loading branch information
swyxio authored Dec 17, 2018
2 parents 1d541c9 + e90a7db commit 714ace4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ function webpackConfig(dir, additionalConfig) {
webpackConfig.entry[name] = "./" + file;
}
});
if (Object.keys(webpackConfig.entry) < 1) {
console.warn(
`
---Start netlify-lambda notification---
WARNING: No valid single functions files (ending in .mjs, .js or .ts) were found.
This could be because you have nested them in a folder.
If this is expected (e.g. you have a zipped function built somewhere else), you may ignore this.
---End netlify-lambda notification---
`
);
}
if (additionalConfig) {
var webpackAdditional = require(path.join(process.cwd(), additionalConfig));

Expand Down

0 comments on commit 714ace4

Please sign in to comment.