Skip to content

Commit

Permalink
UHF-11009: Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Jan 14, 2025
1 parent 421f59f commit 98b8a3f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ A base module for [drupal-helfi-platform](https://github.com/City-of-Helsinki/dr
- [Remote Entity](documentation/remote-entity.md): A base entity to be used with migrations.
- [Testing](documentation/testing.md): Various features to help with automated testing.
- [User expire](/documentation/user-expire.md): Block inactive accounts automatically.
- [Asset versioning](./documentation/asset-versioning.md): Replace js/css library version with deployment identifier.

## Contact

Expand Down
17 changes: 17 additions & 0 deletions documentation/asset-versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Asset versioning

Helfi api base replaces `HELFI_DEPLOYMENT_IDENTIFIER` in libraries.yml files with `filemtime()` of composer.lock file. This can be used in theme or module libraries.yml files to automatically bust caches when dependencies are updated.

Example:
```
my-library:
version: HELFI_DEPLOYMENT_IDENTIFIER
js:
dist/js/my-library.min.js: {
preprocess: false,
minified: true
}
dependencies:
- core/drupalSettings
- core/drupal
```

0 comments on commit 98b8a3f

Please sign in to comment.