Next.js Discord

Discord Forum

Aws Amplify - next 15

Unanswered
Californian posted this in #help-forum
Open in Discord
CalifornianOP
Hello, how do you deal with size of build on AWS Amplify?

2024-11-18T10:28:02.665Z [ERROR]: !!! CustomerError: The size of the build output (434093720) exceeds the max allowed size of230686720 bytes. Please reduce the size ofyour build output and try again.

I have this script for amplify

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci --include=optional
        - npm install --os=linux --cpu=x64 sharp
    build:
      commands:
        - env | grep -e NEXT_PUBLIC_ >> .env.production
        - npm run build
        - du -d 1 -h .next
        - pushd .next/server/pages && find . \( \! -name "*nft.json" -and -name "*.json" \) -exec rm  {} \; && popd
        - du -d 1 -h .next
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - .next/cache/**/*
      - node_modules/**/*

1 Reply

CalifornianOP
I see that on amplify is limit to 220 mb of build, but then how big next apps are implemented on amplify if there is limit of build size?