I developed a micro-front end UI app, the application is running on local by npm start
command, but now I want to deploy it, for that I need to publish it using build command, when I am trying to run npm build --prod
or just npm build
, its not throwing any error but I don't see any dist folder created in my app root folder.
Below is my package.json and app structure:
{
"name": "root-html-file",
"description": "The single-spa root config for coexisting-angular-microfrontends",
"main": "index.js",
"scripts": {
"start": "serve -s -l 4200",
},
"author": "Joel Denning",
"license": "MIT",
"devDependencies": {
"serve": "^11.1.0"
},
"dependencies": {}
}
When we build the app on the azure cloud server, Azure devops will checkout the source code from the repo to the build agent. Then the output of the build pipeline will save on this agent instead of our repo.
So, we could not see the
dist
folder from the repo. It is saved in the local folder on the agent. We need use the copy files and publish build artifact task to publish build artifacts to Azure Pipelines.Note: The
Source Folder
in the copy files task should beAgent.BuildDirectory
orSystem.DefaultWorkingDirectory
instead of directly selecting the path in the repo through the extension button.If above not help you, please share you build log, so that we could check if the dist folder created or not.