Browse Source
* chore(yarn): Install babel-plugin-preval as development dependency * feat(babel): Add preval as a plugin * feat(emojione_light): Prevaled module what tree-shaked emojione * refactor(emoji): Use emojione_light * feat: Preload emojione_picker bundle * fix(emojione_light): Do not use Object.entries * fix(emojify): Update tests * chore(emojione_light): Remove silly ascii artpull/5/head
7 changed files with 39 additions and 20 deletions
@ -0,0 +1,11 @@
|
||||
// @preval
|
||||
// Force tree shaking on emojione by exposing just a subset of its functionality
|
||||
|
||||
const emojione = require('emojione'); |
||||
|
||||
const mappedUnicode = emojione.mapUnicodeToShort(); |
||||
|
||||
module.exports.unicodeToFilename = Object.keys(emojione.jsEscapeMap) |
||||
.map(unicodeStr => [unicodeStr, mappedUnicode[emojione.jsEscapeMap[unicodeStr]]]) |
||||
.map(([unicodeStr, shortCode]) => ({ [unicodeStr]: emojione.emojioneList[shortCode].fname })) |
||||
.reduce((x, y) => Object.assign(x, y), { }); |
||||
Loading…
Reference in new issue