With xLayers version-stamp we've started a new initiative of providing a community-driven way of version stamping that will help on a daily base for everybody! The xLayers projects are driven by community contributions. Please send us your Pull Requests and feedback!
-
Add
@xlayers/version-stamp
to your projectng add @xlayers/version-stamp
-
The package will make some small changes to the
angular.json
-
Add the following snippet (only the version property) to your environment files.
export const environment = {
production: false,
version: '_BUILD_HASH_',
};
- Use the version that the packages has provided in your
environment
properties.
import { environment } from '../environment'
```
```ts
@Component({
selector: 'xlayers-builders-root',
})
export class AppComponent {
version = environment.version;
}
```
5. Now you can stamp your build
```sh
ng run <your-app>:stamp
You can adjust some options to your needs. The available options are:
--version
- You can put in here your own version.
Example:
ng run <your-app>:stamp --version="1.0.0"
--files
- You can put in here the list of file patterns containing_BUILD_HASH_
Example:
ng run <your-app>:stamp --files=*.js,*.json
You can also set the configuration in angular.json
"stamp": {
"builder": "@xlayers/version-stamp:stamp",
"options": {
"outputPath": "dist/packages/demo",
"files": ["*.js", "*.json"]
}
}
Want to file a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]