This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Benchmark = require("benchmark"); | |
const fm = require("front-matter"); | |
const fs = require("fs-extra"); | |
const glob = require("glob"); | |
const path = require("path"); | |
const readlinestream = require("./stream"); | |
const matter = require("gray-matter"); | |
async function grayMatter(fixtures) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matter from 'gray-matter'; | |
import {createHash} from 'crypto'; | |
import _ from 'lodash'; | |
import escapeStringRegexp from 'escape-string-regexp'; | |
import fs from 'fs-extra'; | |
import readline from 'readline'; | |
import {once} from 'events'; | |
function isSeparator(line: string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function(babel) { | |
const { types: t } = babel; | |
return { | |
name: "ast-transform", // not required | |
visitor: { | |
ObjectExpression(path) { | |
var source = path.node.source.value; | |
if (source !== '@generated/registry') return; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getIePolyfill(siteDir: string) { | |
let iePolyfill = ''; | |
const env = | |
process.env.NODE_ENV === 'production' ? 'production' : 'development'; | |
const supportedBrowsers = browserslist(undefined, {path: siteDir, env}); | |
if ( | |
supportedBrowsers.includes('ie 9') || | |
supportedBrowsers.includes('ie 10') | |
) { |
function Clock(props) {
const [date, setDate] = useState(new Date());
useEffect(() => {
var timerID = setInterval(() => tick(), 1000);
return function cleanup() {
clearInterval(timerID);
};
});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const Benchmark = require('benchmark'); | |
const suite = new Benchmark.Suite(); | |
const files = [ | |
'C:\\temp\\myfile.html', | |
'a.md', | |
'hello/super.js', | |
'test.ts', | |
'superman/hello/haha.md', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const globby = require("globby"); | |
const fs = require("fs-extra"); | |
const path = require("path"); | |
const fetch = require("node-fetch"); | |
function randomName(length) { | |
let result = ""; | |
const characters = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
const charactersLength = characters.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require(`path`); | |
class InlineManifestHtmlWebpackPlugin { | |
constructor(options) { | |
this.options = Object.assign( | |
{manifestFileName: 'chunk-map.json', manifestVariable: '__chunkMapping'}, | |
options, | |
); | |
} |
NewerOlder