Is your feature request related to a problem? Please describe.
Currently the next component takes on the responsibility of building the next app. Whilst this is "nice", it makes build issues harder to debug, reduces flexibility of different build workflows users have (especially in CI) and adds overhead to the component development for little value.
Describe the solution you'd like
Fully decouple next build from the component deployment. To deploy users can do:
next build && serverless
If you have a custom build directory:
component: serverless-next.js
inputs:
buildDir: /path/to/.next
To keep the zero config. nature of the component, default value of buildDir will be ./.next. buildDir is the full path to the your distDir configured in next.config.js.
The public and static are expected to be siblings of buildDir.
Additional context
Solves issues #157, #149, #210