Move data in src

So that it’s then compiled into dist
nolan/hinaloe-test
Etienne Lemay 2017-09-28 19:24:17 -04:00
parent 3ed6b746bc
commit e8dc29bfaa
8 changed files with 12 additions and 18 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
node_modules/
data/data.js
dist/
bundle.js

View File

@ -61,11 +61,10 @@
"webpack": "^3.6.0"
},
"scripts": {
"clean": "rimraf data/data.js dist/",
"clean:dist": "rm -rf dist/",
"clean": "rm -rf dist/",
"build:data": "node scripts/build-data",
"build:dist": "npm run clean:dist && babel src --out-dir dist --copy-files --ignore webpack.config.js",
"build": "npm run build:data && npm run build:dist",
"build:dist": "npm run clean && babel src --out-dir dist --copy-files --ignore webpack.config.js",
"build": "npm run build:dist && npm run build:data",
"watch": "babel src --watch --out-dir dist --copy-files --ignore webpack.config.js",
"start": "npm run storybook",
"stats": "webpack --config ./src/webpack.config.js --json > stats.json",

View File

@ -136,11 +136,7 @@ emojiData.forEach((datum) => {
var flags = data.categories[categoriesIndex['Flags']]
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
const stringified = JSON.stringify(data).replace(/\"([A-Za-z_]+)\":/g, '$1:')
fs.writeFile('data/data.js', `module.exports = ${stringified}`, (err) => {
if (err) throw err
})
})

View File

@ -1,6 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import data from '../../data'
import data from '../data'
import { getData, getSanitizedData, unifiedToNative } from '../utils'

View File

@ -3,7 +3,7 @@ import '../vendor/raf-polyfill'
import React from 'react'
import PropTypes from 'prop-types'
import measureScrollbar from 'measure-scrollbar'
import data from '../../data'
import data from '../data'
import store from '../utils/store'
import frequently from '../utils/frequently'

View File

@ -1,5 +1,5 @@
var buildSearch = require('../src/utils/build-search')
var data = require('./data')
import buildSearch from '../utils/build-search'
import data from './data'
function uncompress (list) {
for (var short_name in list) {
@ -29,4 +29,4 @@ function uncompress (list) {
uncompress(data.emojis)
uncompress(data.skins)
module.exports = data
export default data

View File

@ -1,4 +1,4 @@
import data from '../../data'
import data from '../data'
import { getData, getSanitizedData, uniq } from '.'
var index = {}

View File

@ -1,5 +1,5 @@
import buildSearch from './build-search'
import data from '../../data'
import data from '../data'
import stringFromCodePoint from '../polyfills/stringFromCodePoint'
const _JSON = JSON