npm build(nuxt build)不会在使用nuxt spa模式的amplify(aws codebuild)中创建dist文件夹

问题描述 投票:2回答:1

我要在放大后运行'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/**/*

我正在等待您的回答,谢谢。

vue.js single-page-application nuxt.js aws-amplify aws-codebuild
1个回答
0
投票

我解决了它,设置了amplify.yml文件。我将baseDirectory: dist更改为baseDirectory: .nuxt

© www.soinside.com 2019 - 2024. All rights reserved.