簡體   English   中英

基本 vue.js 上的 dist 文件夾

[英]dist folder on basic vue.js

我使用 Visual Studio 2019 創建了一個基本的 vue.js。我將它放在我的私人 azure 服務器的 git 上。 我有一個 windows 構建代理。

yml 用於構建,沒有錯誤。

trigger:
- master

pool: 'Default'

- script: |
    npm install
    npm run build
  displayName: 'npm install and build'

我嘗試了一些“復制/存檔文件”命令。 其中之一

- task: CopyFiles@2
  displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)/VuejsApp1'
  inputs:
    TargetFolder: '$(Build.ArtifactStagingDirectory)/VuejsApp1'

每種方法似乎都表明從未創建 dist 文件夾。

類似的問題: 為什么 azure 構建管道沒有為 angular 構建生成 dist 文件夾


##[section]開始:npm安裝和構建======================================= ======================================== 任務:命令行 描述:運行命令行腳本using Bash on Linux and macOS and cmd.exe on Windows Version: 2.151.1 Author: Microsoft Corporation Help: https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line ==== ==================================================== ========================= 生成腳本。 ========================== 啟動命令 Output ==================== ====== ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\DevOpsAgent_work_temp\2d81f910-5c00-4330 -9d13-27c8c30aa7a0.cmd""

yorkie@2.0.0 安裝 C:\DevOpsAgent_work\171\s\node_modules\yorkie 節點 bin/install.js

檢測到 CI,跳過 Git 掛鈎安裝

core-js@2.6.11 postinstall C:\DevOpsAgent_work\171\s\node_modules\core-js node -e "try{require('./postinstall')}catch(e){}"

感謝您使用 core-js ( https://github.com/zloirock/core-js ) 來填充 JavaScript 標准庫!

該項目需要您的幫助:請考慮在 Open Collective 或 Patreon 上支持 core-js: > https.//opencollective:com/core-js > https: //www.patreon.com /zloirock

另外,core-js的作者(https://github.com/zloirock)正在找一份好工作-)

ejs@2.7.4 安裝后 C:\DevOpsAgent_work\171\s\node_modules\ejs node./postinstall.js

感謝您安裝 EJS:使用 Jake JavaScript 構建工具構建 (https://jakejs.com/)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin ","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\ node_modules\fsevents): npm WARN notsup 跳過可選依賴: fsevents@1.2.13 不支持的平台: 想要 {"os":"darwin","arch":"any"} (當前: {"os":"win32" ,"arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os": "darwin","arch":"any"} (當前: {"os":"win32","arch":"x6 4"})

添加了來自 822 位貢獻者的 1488 個包,並在 71.233 秒內審核了 1492 個包

44包正在尋找資金跑npm fund詳情

發現 6 個漏洞(1 個低、3 個中等、2 個高)運行npm audit fix以修復它們,或npm audit了解詳細信息##[section]Finishing: npm 安裝和構建

首先,您不需要在相同的“腳本”上進行安裝和構建。

- script: 'npm install'
  displayName: 'Install dependencies'

- script: 'npm run build'
  displayName: 'Build project'

之后,您可以獲取 dist 文件夾

- task: CopyFiles@2
  displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
  inputs:
    SourceFolder: '$(Build.SourcesDirectory)/dist'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'

有兩個故障排除建議:

1.嘗試在本地構建,或者使用Azure DevOps的PowerShell任務運行npm命令,看看是否存在同樣的問題。

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      npm install
      npm run build

2.檢查 json 文件中的options參數是否設置為dist

  "options": {
        "outputPath": "dist",
       }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM