Rename dirs to avoid creating lambdas (#91)

This commit is contained in:
Steven 2019-07-25 15:02:30 -04:00 committed by GitHub
parent a13bfb3c9d
commit c06a2f573d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 9 additions and 9 deletions

View File

@ -7,9 +7,9 @@ const twemoji = require('twemoji');
const twOptions = { folder: 'svg', ext: '.svg' };
const emojify = (text: string) => twemoji.parse(text, twOptions);
const regular = readFileSync(`${__dirname}/../fonts/Inter-Regular.woff2`).toString('base64');
const bold = readFileSync(`${__dirname}/../fonts/Inter-Bold.woff2`).toString('base64');
const mono = readFileSync(`${__dirname}/../fonts/Vera-Mono.woff2`).toString('base64');
const rglr = readFileSync(`${__dirname}/../_fonts/Inter-Regular.woff2`).toString('base64');
const bold = readFileSync(`${__dirname}/../_fonts/Inter-Bold.woff2`).toString('base64');
const mono = readFileSync(`${__dirname}/../_fonts/Vera-Mono.woff2`).toString('base64');
function getCss(theme: string, fontSize: string) {
let background = 'white';
@ -26,7 +26,7 @@ function getCss(theme: string, fontSize: string) {
font-family: 'Inter';
font-style: normal;
font-weight: normal;
src: url(data:font/woff2;charset=utf-8;base64,${regular}) format('woff2');
src: url(data:font/woff2;charset=utf-8;base64,${rglr}) format('woff2');
}
@font-face {

View File

@ -1,8 +1,8 @@
import { IncomingMessage, ServerResponse } from 'http';
import { parseRequest } from './parser';
import { getScreenshot } from './chromium';
import { getHtml } from './template';
import { writeTempFile, pathToFileURL } from './file';
import { parseRequest } from './_lib/parser';
import { getScreenshot } from './_lib/chromium';
import { getHtml } from './_lib/template';
import { writeTempFile, pathToFileURL } from './_lib/file';
const isDev = process.env.NOW_REGION === 'dev1';
const isHtmlDebug = process.env.OG_HTML_DEBUG === '1';

View File

@ -1,4 +1,4 @@
import { ParsedRequest, Theme, FileType } from '../api/types';
import { ParsedRequest, Theme, FileType } from '../api/_lib/types';
const { H, R, copee } = (window as any);
let timeout = -1;