Skip to content

Commit 0cee199

Browse files
authored
Merge pull request #20334 from mozilla/FXA-13363
fix(settings): add hashFunction to grunt for more unique ftl hashes
2 parents d1ed593 + a6d1119 commit 0cee199

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/fxa-settings/Gruntfile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
const crypto = require('crypto');
6+
57
module.exports = function (grunt) {
68
const srcPaths = ['.license.header', 'src/**/*.ftl'];
79
const testPaths = [
@@ -42,6 +44,12 @@ module.exports = function (grunt) {
4244
mapping: 'public/static/static-asset-manifest.json', // The file where the hashed file names will be stored
4345
srcBasePath: 'public/', // the base Path you want to remove from the `key` string in the mapping file
4446
destBasePath: 'public/static',
47+
hashFunction: function (source, encoding) {
48+
return crypto
49+
.createHash('md5')
50+
.update(source, encoding)
51+
.digest('hex');
52+
},
4553
},
4654
locales: {
4755
expand: true,

0 commit comments

Comments
 (0)