I am creating an Azure DevOps build pipeline for one of my Vue.js projects and always getting the preceding error.
./index.js → ./dist/bundle.esm.js... [!] Error: Could not resolve './src/components/uiListItem.vue' from index.js Error: Could not resolve './src/components/uiListItem.vue' from index.js at error (/home/vsts/work/1/s/node_modules/rollup/dist/shared/node-entry.js:5400:30) at ModuleLoader.handleResolveId (/home/vsts/work/1/s/node_modules/rollup/dist/shared/node-entry.js:12410:24) at ModuleLoader. (/home/vsts/work/1/s/node_modules/rollup/dist/shared/node-entry.js:12298:30) at Generator.next () at fulfilled (/home/vsts/work/1/s/node_modules/rollup/dist/shared/node-entry.js:38:28)
The command npm run build and npm run build --prod works fine in local and the issue is only with the Pipeline environment. Here is my azure-pipeline.yml.
trigger:
branches:
include:
- master
variables:
- name: tag
value: '$(Build.BuildId)'
- name: vmImageName
value: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: Npm@1
displayName: 'npm install'
inputs:
command: 'install'
workingDir: '$(Build.SourcesDirectory)'
verbose: false
- task: Npm@1
displayName: 'npm run build'
inputs:
command: 'custom'
workingDir: '$(Build.SourcesDirectory)'
customCommand: 'run build'

