Skip to content

Commit cee330c

Browse files
committed
use modifyConfig to set standalone output
1 parent 2afe782 commit cee330c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/adapter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import type { NextAdapter } from 'next-with-adapters'
33
const adapter: NextAdapter = {
44
name: 'Netlify',
55
modifyConfig(config) {
6+
// Enable Next.js standalone mode at build time
7+
config.output = 'standalone'
8+
69
console.log('modifyConfig hook called')
710
return config
811
},

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ export const onPreBuild = async (options: NetlifyPluginOptions) => {
5050
}
5151

5252
await tracer.withActiveSpan('onPreBuild', async () => {
53-
// Enable Next.js standalone mode at build time
54-
process.env.NEXT_PRIVATE_STANDALONE = 'true'
5553
const ctx = new PluginContext(options)
5654
if (options.constants.IS_LOCAL) {
5755
// Only clear directory if we are running locally as then we might have stale functions from previous

0 commit comments

Comments
 (0)