From 1b0cf55566a825f5f0e69be1cf523ddee7a03f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Thu, 21 Jan 2021 09:58:59 +0000 Subject: [PATCH] Use new default functions directory Related: https://github.com/netlify/build/pull/2188 --- .gitignore | 2 +- README.md | 2 +- index.js | 2 +- test/index.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4dd535be31..3e9432bb10 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ # Test test/sample/node_modules test/sample/out_functions -test/sample/netlify-automatic-functions +test/sample/netlify/functions test/sample/my-publish-dir test/sample/.next test/sample/.netlify diff --git a/README.md b/README.md index 1b57ab5c78..a5fbf3c91c 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ If you'd like to build and deploy your project using the [Netlify CLI](https://d 2. Run any number of builds and deploys freely (i.e. `netlify build`, `netlify deploy --build`, `netlify deploy --prod`) 3. Run `git stash --include-unstaged` to easily ignore plugin-generated files -Plugin-generated files will output into either (a) the default functions and publish directories (`netlify-automatic-functions` and `.`, respectively) or (b) whichever custom functions and publish directories you configure. See below for custom directory configuration. It's important to note that, in both cases (a) and (b), the CLI may mix your project's source code and plugin-generated files; this is why we recommend committing all project source files before running CLI builds. +Plugin-generated files will output into either (a) the default functions and publish directories (`netlify/functions` and `.`, respectively) or (b) whichever custom functions and publish directories you configure. See below for custom directory configuration. It's important to note that, in both cases (a) and (b), the CLI may mix your project's source code and plugin-generated files; this is why we recommend committing all project source files before running CLI builds. **Debugging CLI builds:** - If you're seeing a `{FILE_NAME} already exists` error running a CLI build, this may be because your `node_modules` got purged between builds or because of lingering unstashed files from outdated builds. To resolve, you need to manually remove any plugin-generated files from your project directory. diff --git a/index.js b/index.js index 3232327b8f..e5f6357f82 100644 --- a/index.js +++ b/index.js @@ -85,4 +85,4 @@ module.exports = { }, } -const DEFAULT_FUNCTIONS_SRC = 'netlify-automatic-functions' +const DEFAULT_FUNCTIONS_SRC = 'netlify/functions' diff --git a/test/index.js b/test/index.js index d9e32cb408..26b904c30f 100644 --- a/test/index.js +++ b/test/index.js @@ -186,7 +186,7 @@ describe('onBuild()', () => { test.each([ { FUNCTIONS_SRC: 'functions', resolvedFunctions: 'functions' }, - { FUNCTIONS_SRC: undefined, resolvedFunctions: 'netlify-automatic-functions' }, + { FUNCTIONS_SRC: undefined, resolvedFunctions: 'netlify/functions' }, ])('copy files to the functions directory', async ({ FUNCTIONS_SRC, resolvedFunctions }) => { await useFixture('functions_copy_files') await moveNextDist()