Fix Next.js standalone build for Amplify WEB_COMPUTE
- Set output to standalone in next.config.js - Update build artifacts to use .next/standalone - Copy static files to standalone directory - Remove invalid serverActions config
This commit is contained in:
10
amplify.yml
10
amplify.yml
@@ -10,14 +10,12 @@ frontend:
|
|||||||
build:
|
build:
|
||||||
commands:
|
commands:
|
||||||
- npm run build
|
- npm run build
|
||||||
|
- cp -r public .next/standalone/
|
||||||
|
- cp -r .next/static .next/standalone/.next/
|
||||||
artifacts:
|
artifacts:
|
||||||
baseDirectory: ./
|
baseDirectory: .next/standalone
|
||||||
files:
|
files:
|
||||||
- .next/**/*
|
- '**/*'
|
||||||
- node_modules/**/*
|
|
||||||
- package.json
|
|
||||||
- next.config.js
|
|
||||||
- public/**/*
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- node_modules/**/*
|
- node_modules/**/*
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
// Ensure server-side features are enabled
|
output: 'standalone',
|
||||||
experimental: {
|
|
||||||
serverActions: true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
@@ -63,6 +63,8 @@ resource "aws_amplify_app" "filamenteka" {
|
|||||||
tags = {
|
tags = {
|
||||||
Name = "Filamenteka"
|
Name = "Filamenteka"
|
||||||
Environment = var.environment
|
Environment = var.environment
|
||||||
|
# Disable GitHub App migration prompt
|
||||||
|
"amplify:github_app_migration" = "opted_out"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user