Did you ever create bash scripts that you've used in multiple projects to do version stamp your Angular application?
Today we are very happy to announce 🎉 @xlayers/version-stamp 🎉 an Angular Builder that will help you to version stamp your Angular apps.
How to use version-stamp
1.Navigate to your Angular project
2.Add @xlayers/version-stamp to your project
ng add @xlayers/version-stamp
The package will make some small changes to the angular.json
3.Add the following snippet (only the version property) to your environment files.
export const environment = {
production: false,
version: "_BUILD_HASH_"
};
4.Use the version that the packages has provided in your environment properties.
import { environment } from "../environment";
@Component({
selector: "xlayers-root"
})
export class AppComponent {
version = environment.version;
}
5.Now you can stamp your app by running
ng run <your-app>:stamp
or use --version
for a specific version
ng run <your-app>:stamp --version="1.2.1"
6.When we navigate to our dist
folder we can look at our code and see something that is similiar to the picture below
Thank you
Thank you for reading our article, we hope this article encourages you to try xLayers products as it is fairly easy to use and provides a lot of value in the collaboration between designers and developers.
Would you like to help us with xLayers by contributing? We have issues for first-timers and we are willing to help you in all possible ways. Next to contributing you can help us by donating, this way we can develop more features that are on our roadmap.
Top comments (3)
Is the picture missing at the end?
I've added the picture thank you!
Looks like it will update it soon. Thanks for pointing this to us