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

warn before running function builder #216

Merged
merged 2 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ class DevCommand extends Command {
if (functionsDir) {
const functionBuilder = await detectFunctionsBuilder(settings);
if (functionBuilder) {
this.log(
`${NETLIFYDEVLOG} Function builder ${chalk.yellow(
functionBuilder.builderName
)} detected: Running npm script ${chalk.yellow(
functionBuilder.npmScript
)}`
);
this.warn(
`${NETLIFYDEVWARN} This is a beta feature, please give us feedback on how to improve at https://github.com/netlify/netlify-dev-plugin/`
);
await functionBuilder.build();
const functionWatcher = chokidar.watch(functionBuilder.src);
functionWatcher.on("add", functionBuilder.build);
Expand Down
1 change: 1 addition & 0 deletions src/function-builder-detectors/netlify-lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = function() {
if (settings.npmScript) {
settings.build = () =>
execa(yarnExists ? "yarn" : "npm", ["run", settings.npmScript]);
settings.builderName = "netlify-lambda";
return settings;
}
};