1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-12-27 03:16:23 +00:00

Also generate twemoji.esm.js

This commit is contained in:
Nathan Downs 2019-05-29 13:43:48 -07:00
parent a2b8b5d88c
commit 68306e0278
2 changed files with 8 additions and 5 deletions

View File

@ -44,13 +44,13 @@ spawnSync(
] ]
); );
fs.writeFileSync( const copyright = '/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */';
file('twemoji.min.js'), const minifiedContents = fs.readFileSync(file('twemoji.tmp.js'));
'/*! Copyright Twitter Inc. and other contributors. Licensed under MIT */\n' +
fs.readFileSync(file('twemoji.tmp.js'))
);
fs.unlinkSync(file('twemoji.tmp.js')); fs.unlinkSync(file('twemoji.tmp.js'));
fs.writeFileSync(file('twemoji.min.js'), `${copyright}\n${minifiedContents}`);
fs.writeFileSync(file('twemoji.esm.js'), `${copyright}\n${minifiedContents}\nexport default twemoji;`);
const algorithm = 'sha384'; const algorithm = 'sha384';
const digest = spawnSync('openssl', ['dgst', `-${algorithm}`, '-binary', file('twemoji.min.js')]); const digest = spawnSync('openssl', ['dgst', `-${algorithm}`, '-binary', file('twemoji.min.js')]);
if (digest.status || digest.signal){ if (digest.status || digest.signal){

3
2/twemoji.esm.js Normal file

File diff suppressed because one or more lines are too long