parent
3ed6b746bc
commit
e8dc29bfaa
|
@ -1,4 +1,3 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
data/data.js
|
|
||||||
dist/
|
dist/
|
||||||
bundle.js
|
bundle.js
|
||||||
|
|
|
@ -61,11 +61,10 @@
|
||||||
"webpack": "^3.6.0"
|
"webpack": "^3.6.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf data/data.js dist/",
|
"clean": "rm -rf dist/",
|
||||||
"clean:dist": "rm -rf dist/",
|
|
||||||
"build:data": "node scripts/build-data",
|
"build:data": "node scripts/build-data",
|
||||||
"build:dist": "npm run clean:dist && babel src --out-dir dist --copy-files --ignore webpack.config.js",
|
"build:dist": "npm run clean && babel src --out-dir dist --copy-files --ignore webpack.config.js",
|
||||||
"build": "npm run build:data && npm run build:dist",
|
"build": "npm run build:dist && npm run build:data",
|
||||||
"watch": "babel src --watch --out-dir dist --copy-files --ignore webpack.config.js",
|
"watch": "babel src --watch --out-dir dist --copy-files --ignore webpack.config.js",
|
||||||
"start": "npm run storybook",
|
"start": "npm run storybook",
|
||||||
"stats": "webpack --config ./src/webpack.config.js --json > stats.json",
|
"stats": "webpack --config ./src/webpack.config.js --json > stats.json",
|
||||||
|
|
|
@ -136,11 +136,7 @@ emojiData.forEach((datum) => {
|
||||||
var flags = data.categories[categoriesIndex['Flags']]
|
var flags = data.categories[categoriesIndex['Flags']]
|
||||||
flags.emojis.sort()
|
flags.emojis.sort()
|
||||||
|
|
||||||
mkdirp('data', (err) => {
|
const stringified = JSON.stringify(data).replace(/\"([A-Za-z_]+)\":/g, '$1:')
|
||||||
|
fs.writeFile('dist/data/data.js', `module.exports = ${stringified}`, (err) => {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
|
|
||||||
const stringified = JSON.stringify(data).replace(/\"([A-Za-z_]+)\":/g, '$1:')
|
|
||||||
fs.writeFile('data/data.js', `module.exports = ${stringified}`, (err) => {
|
|
||||||
if (err) throw err
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import data from '../../data'
|
import data from '../data'
|
||||||
|
|
||||||
import { getData, getSanitizedData, unifiedToNative } from '../utils'
|
import { getData, getSanitizedData, unifiedToNative } from '../utils'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import '../vendor/raf-polyfill'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import measureScrollbar from 'measure-scrollbar'
|
import measureScrollbar from 'measure-scrollbar'
|
||||||
import data from '../../data'
|
import data from '../data'
|
||||||
|
|
||||||
import store from '../utils/store'
|
import store from '../utils/store'
|
||||||
import frequently from '../utils/frequently'
|
import frequently from '../utils/frequently'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var buildSearch = require('../src/utils/build-search')
|
import buildSearch from '../utils/build-search'
|
||||||
var data = require('./data')
|
import data from './data'
|
||||||
|
|
||||||
function uncompress (list) {
|
function uncompress (list) {
|
||||||
for (var short_name in list) {
|
for (var short_name in list) {
|
||||||
|
@ -29,4 +29,4 @@ function uncompress (list) {
|
||||||
uncompress(data.emojis)
|
uncompress(data.emojis)
|
||||||
uncompress(data.skins)
|
uncompress(data.skins)
|
||||||
|
|
||||||
module.exports = data
|
export default data
|
|
@ -1,4 +1,4 @@
|
||||||
import data from '../../data'
|
import data from '../data'
|
||||||
import { getData, getSanitizedData, uniq } from '.'
|
import { getData, getSanitizedData, uniq } from '.'
|
||||||
|
|
||||||
var index = {}
|
var index = {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import buildSearch from './build-search'
|
import buildSearch from './build-search'
|
||||||
import data from '../../data'
|
import data from '../data'
|
||||||
import stringFromCodePoint from '../polyfills/stringFromCodePoint'
|
import stringFromCodePoint from '../polyfills/stringFromCodePoint'
|
||||||
|
|
||||||
const _JSON = JSON
|
const _JSON = JSON
|
||||||
|
|
Loading…
Reference in New Issue