Closed
Description
All Next.js page/function files are initially copied by next-on-netlify
to out_functions
and out_publish
.
This plugin then copies all those files from out_functions
and out_publish
to the site's Functions/publish directories.
If those are lots of files, this additional copy step might end take lots of build time. Instead, we could remove that intermediary step:
- Make the main function exported by
netlify-on-netlify
accepts anoptions
object so users can customize the location ofout_functions
andout_publish
:
https://github.com/netlify/next-on-netlify/blob/a9dade3824d1288770d967cc6f57f238d5947367/index.js#L7
const nextOnNetlify = ({ functionsDir = "out_functions", publishDir = "out_publish" } = {}) => {
- Pass
constants.FUNCTIONS_SRC
andconstants.PUBLISH_DIR
tonext-on-netlify
- Remove the additional copy step 🎉
As a follow-up, we can also expose those to next-on-netlify
CLI.
What do you think @lindsaylevine?