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 captureWebRTCAudio = (successHandler) => { | |
return navigator.mediaDevices.getUserMedia({audio: true, video: false}).then(successHandler); | |
}; | |
export default captureWebRTCAudio; |
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 webpackMerge = require("webpack-merge"); | |
const applyPresets = (env = { presets: [] }) => { | |
const presets = env.presets || []; | |
/** @type {string[]} */ | |
const mergedPresets = [].concat(...[presets]); | |
const mergedConfigs = mergedPresets.map(presetName => require(`./presets/webpack.${presetName}`)(env)); | |
return webpackMerge({}, ...mergedConfigs); | |
}; |
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 puppetteer = require("puppeteer"); | |
/** | |
* @param {string} pageUrl The URL that you want to gather coverage data for | |
*/ | |
const unusedCode = async pageUrl => { | |
const browser = await puppetteer.launch(); | |
console.log("browser launched"); | |
const page = await browser.newPage(); | |
console.log("new page created"); |
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 pluginMeta = { name: "BomPlugin" }; | |
class BomPlugin { | |
constructor(encoding = "\ufeff") { | |
this.encoding = encoding; | |
} | |
apply(/** @type {import("webpack/lib/Compiler")}*/ compiler) { | |
compiler.hooks.compilation.tap(pluginMeta, ( | |
/** @type {import("webpack/lib/Compilation")}*/ compilation, | |
params |
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 PaintModule from "./somePaintModule.js"; | |
/** | |
* if user wanted to code split they pass | |
* const PaintModule = () => import("./somePaintModule.js") | |
*/ | |
CSS.paintWorklet.addModule(PaintModule) | |
// Therefore the surface api operates the same in the users eyes |
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 chalk = require("chalk"); | |
const { performance } = require("perf_hooks"); | |
class ProfilingPlugin { | |
apply(compiler) { | |
// Compiler Hooks | |
Object.keys(compiler.hooks).forEach(hookName => { | |
compiler.hooks[hookName].intercept(makeInterceptorFor("Compiler")(hookName)) | |
}); | |
Object.keys(compiler.resolverFactory.hooks).forEach(hookName => { |
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'); | |
const Benchmark = require('benchmark'); | |
const suite = new Benchmark.Suite; | |
const ts = require('typescript'); | |
const acorn = require('acorn'); | |
const babylon = require('babylon'); |
This file has been truncated, but you can view the full file.
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
{ | |
"errors": [], | |
"warnings": [], | |
"version": "3.6.0", | |
"hash": "87cd04b20883a998cc03", | |
"time": 283, | |
"publicPath": "", | |
"assetsByChunkName": { | |
"main": "main.chunk.js" | |
}, |
This file has been truncated, but you can view the full file.
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
{ | |
"errors": [], | |
"warnings": [], | |
"version": "3.6.0", | |
"hash": "87cd04b20883a998cc03", | |
"time": 283, | |
"publicPath": "", | |
"assetsByChunkName": { | |
"main": "main.chunk.js" | |
}, |
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
#!/bin/bash | |
ARRAY=( | |
"webpack:webpack" | |
"webpack:example-app" | |
"webpack:enhanced-require" | |
"webpack:webpack-dev-middleware" | |
"webpack:enhanced-resolve" | |
"webpack:template" | |
"webpack:webpack-dev-server" |
NewerOlder