diff --git a/README.md b/README.md index 30f93469..de09c2cb 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,11 @@ Use the following in the `` tag of your HTML document(s): This guarantees that you will always use the latest version of the library. +If, instead, you'd like to include the latest version explicitly, you can add the following tag: +```html + +``` + ### Download If instead you want to download a specific version, please look at the `gh-pages` branch, where you will find the built assets for both our latest and older versions. diff --git a/scripts/create-dist b/scripts/create-dist index fff1e4a9..e7382940 100755 --- a/scripts/create-dist +++ b/scripts/create-dist @@ -7,6 +7,7 @@ const fs = require('fs-extra'); const path = require('path'); const { spawnSync } = require('child_process'); +const { getIntegrityHash } = require('./utils'); function file(...which) { return path.join(__dirname, '..', ...which); @@ -55,6 +56,16 @@ fs.unlinkSync(distFile('twemoji.tmp.js')); fs.writeFileSync(distFile('twemoji.min.js'), `${copyright}\n${minifiedContents}`); fs.writeFileSync(distFile('twemoji.esm.js'), `${copyright}\n${minifiedContents}\nexport default twemoji;`); +const integrityHash = getIntegrityHash(distFile('twemoji.min.js')); +const { version } = require('../package.json'); + +function updateSriScriptReference(filename) { + const newScript = ` +