Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs


Generates Subresource Integrity (SRI) values for Local JavaScript and CSS resources, so you don’t have to regenerate them in the admin. Added in MMT 1.0.6. Run it from the root of a checkout (the folder that contains .mmt). File names are relative to that folder; on Windows use backslashes (templates\sfnt.mvt), because a path with forward slashes doesn’t match and is silently ignored.

Usage#

mmt sri [-2] [-3] [-5] [filepaths ...]

Arguments#

Argument Short Required Description
--sha256 -2 No Generate sha256 SRI.
--sha384 -3 No Generate sha384 SRI.
--sha512 -5 No Generate sha512 SRI.
filepaths ... No Local .js or .css files to generate values for. Defaults to every Local JS and CSS resource in the checkout.

Examples#

Generate SHA-384 values for one file, then push them:

mmt sri -3 js/custom.js
mmt push -n "Update SRI for custom.js"
  • With no algorithm flags, MMT uses all three and writes them as one value: sha256-... sha384-... sha512-....
  • It hashes your local .js or .css file as it is now.
  • It writes an integrity attribute into the resource’s .json (for example js/custom.json), and a crossorigin attribute set to anonymous unless the resource already has one.
  • It doesn’t push. Run mmt push to send the updated .json, and the .js or .css if you changed it.
  • Only Local resources (.js and .css files) can be used. Naming any other file gives MMT-COMMAND-SRI-00002.