Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve setup steps on deploying Nuxt app to AWS Amplify on docs #1439

Open
idorenyinudoh opened this issue Dec 2, 2023 · 4 comments
Open
Labels

Comments

@idorenyinudoh
Copy link

Affected page

https://nuxt.com/deploy/aws-amplify

Description

The documentation states that the integration of a Nuxt 3 app with AWS Amplify requires zero configuration. But that is not the case and I'll explain why.

The default build config that AWS Amplify generates is this:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - nvm use 18
        - corepack enable
        - npx --yes nypm i
    build:
      commands:
        - yarn run build
  artifacts:
    baseDirectory: .amplify-hosting
    files:
      - '**/*'

However, Nuxt's build (and generate) command generates an .output directory that contains the app's contents ready to be served.

Hence, the baseDirectory property in Amplify's build config will need to be updated to .output/public. Hence, Nuxt's integration with AWS Amplify isn't zero config.

Happy to open a PR.

P.S: Nitro's docs might be misleading as well.

@pi0
Copy link
Member

pi0 commented Dec 5, 2023

Hi, dear @idorenyinudoh thanks for sharing feedback. The baseDirectory property is correct when we are building within Amplify CI/CD build pipeline, Nitro automatically switches to aws_amplify preset and generates the required structure into .amplify-hosting (you can replicate locally by using --preset amplify_hosting arg or SERVER_PRESET=amplify_hosting).

In regards of zero configs, the yml is fairly a static configuration we advise to add to allow furthor customizatiom however amplify UI should be already able to autodetect Nuxt/Nitro and configure it hence zero config is required.

I will relay your feedback to the amplify team 👍🏼

@idorenyinudoh
Copy link
Author

okay, thanks for the clarification and feedback!

@mauerbac
Copy link
Contributor

mauerbac commented Dec 6, 2023

@idorenyinudoh - let me know if you were able to deploy to AWS Amplify and have any feedback or comments

@idorenyinudoh
Copy link
Author

yeah i was able to but, to get a successful deployment, i had to edit the default config generated by amplify
my only concern is I expected it to be zero config as stated on the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants