Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit a126857

Browse files
authored
warn before running function builder (#216)
* warn before running funciton buidler * better warning
1 parent ef6ed43 commit a126857

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/commands/dev/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ class DevCommand extends Command {
232232
if (functionsDir) {
233233
const functionBuilder = await detectFunctionsBuilder(settings);
234234
if (functionBuilder) {
235+
this.log(
236+
`${NETLIFYDEVLOG} Function builder ${chalk.yellow(
237+
functionBuilder.builderName
238+
)} detected: Running npm script ${chalk.yellow(
239+
functionBuilder.npmScript
240+
)}`
241+
);
242+
this.warn(
243+
`${NETLIFYDEVWARN} This is a beta feature, please give us feedback on how to improve at https://github.com/netlify/netlify-dev-plugin/`
244+
);
235245
await functionBuilder.build();
236246
const functionWatcher = chokidar.watch(functionBuilder.src);
237247
functionWatcher.on("add", functionBuilder.build);

src/function-builder-detectors/netlify-lambda.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = function() {
3535
if (settings.npmScript) {
3636
settings.build = () =>
3737
execa(yarnExists ? "yarn" : "npm", ["run", settings.npmScript]);
38+
settings.builderName = "netlify-lambda";
3839
return settings;
3940
}
4041
};

0 commit comments

Comments
 (0)