我一直在尝试将我的nuxt通用应用程序部署到AWS Elastic beantalk上。我已经尝试在package.json中使用自定义npm脚本:
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"precommit": "npm run lint",
"deploy": "nuxt build && nuxt start"
},
然后在AWS EB配置下,我添加了Node命令:npm run deploy
但是,它不起作用。
基本上,我需要告诉EB在“ npm run start”之前运行“ npm run build”
有人可以帮忙吗?
最佳答案
您所描述的内容位于npm领域,可以通过使用prestart脚本来解决,如下所示:
"prestart": "nuxt build"
此处有更多详细信息:https://docs.npmjs.com/misc/scripts