CLI : add option to specify the output mode to next build #65511
alaindeurveilher
started this conversation in
Ideas
Replies: 1 comment
-
Just a remark, I just noticed a way to perform this with the following, using environment variables:
/** @type {import('next').NextConfig} */
const BUILD_OUTPUT = process.env.NEXT_CONFIG_BUILD_OUTPUT === 'standalone' ? 'standalone' : undefined;
const nextConfig = {
output: BUILD_OUTPUT,
// ...
};
module.exports = nextConfig; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
output
(and/or override it), or to specify a different config file than the defaultnext.config.js
Non-Goals
Background
I have currently a need to deploy an instance of my app on my laptop for localhost usage, and share this installation/deployment strategy with some colleagues in my team.
"standalone" output seems convenient, as I can have it built once, and deployed for
pm2
. Then anyone can run the app through pm2 without opening the development environment.But I would like it to be deployed on some server in OpenShift using the standard default output too for some other purpose
Proposal
See Goals section for the proposal
Example:
next build --output standalone
next build --config-file next.config.standalone.js
Beta Was this translation helpful? Give feedback.
All reactions