Skip to content

Commit

Permalink
Merge branch 'main' of github.com:idleberg/php-vite-manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Jun 9, 2024
2 parents 5a45d41 + 65b0d66 commit c475eea
Show file tree
Hide file tree
Showing 6 changed files with 1,080 additions and 150 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022-2023 Jan T. Sott & contributors
Copyright (c) 2022-2024 Jan T. Sott & contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ To get you going, first instantiate the class exposed by this library
new Manifest(string $manifestPath, string $baseUri, string $algorithm = "sha256");
```

### Parameters

#### `$manifestPath`

Type: `string`

Specifies the path to the manifest.

#### `$baseUri`

Type: `string`

Specifies the base URI for the assets in the manifest.

#### `$algorithm`

Type: `"sha256"` |`"sha384"` |`"sha512"` | `":manifest:"`
Default: `"sha256"`

Specifies the algorithm used for hashing the assets. This will be used can be used for [subsource integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) when printing script or style tags. You can use `":manifest:"` in conjunction with [vite-plugin-manifest-sri](https://github.com/ElMassimo/vite-plugin-manifest-sri), a plug-in that calculates the hashes at build-time and adds them to the manifest.

**Example**

```php
Expand Down
Loading

0 comments on commit c475eea

Please sign in to comment.