我要在放大后运行'npm build'(nuxt build)后创建dist文件夹。
我在local(mac)中运行npm build,然后创建了dist文件夹。
我在'npm build'之后运行'ls -a',然后dist文件夹在放大中不存在。
> nuxt build
2019-08-20T01:49:08.598Z [INFO]: # Executing command: ls -a
2019-08-20T01:49:08.602Z [INFO]: .
..
amplify.sh
amplify.yml
assets
components
.editorconfig
.eslintrc.js
.git
.gitignore
layouts
middleware
node_modules
.nuxt
nuxt.config.js
package.json
package-lock.json
pages
plugins
.prettierrc
README.md
static
store
.vscode
yarn.lock
# Completed phase: build
这里是package.json
{
...
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint"
},
这里是amplify.yml
version: 0.1
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- npm run build
- ls -a
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory:
dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*
我正在等待您的回答,谢谢。
我解决了它,设置了amplify.yml文件。我将baseDirectory: dist
更改为baseDirectory: .nuxt
。