Skip to content

Instantly share code, notes, and snippets.

View TheLarkInn's full-sized avatar
🦀
Getting Rusty

Sean Larkin TheLarkInn

🦀
Getting Rusty
View GitHub Profile
@TheLarkInn
TheLarkInn / _entry.js
Last active July 14, 2017 22:09
Example of using webpack and .wat as a module type
import("./abc.js").then(abc => abc.doIt());
@TheLarkInn
TheLarkInn / Readme.md
Created August 27, 2017 15:27 — forked from monkindey/Readme.md
webpack tapable with log
@TheLarkInn
TheLarkInn / gource.bash
Last active January 20, 2021 20:16 — forked from blake-newman/gource.bash
Create a gource.io of multiple repos
#!/bin/bash
ARRAY=(
"webpack:webpack"
"webpack:example-app"
"webpack:enhanced-require"
"webpack:webpack-dev-middleware"
"webpack:enhanced-resolve"
"webpack:template"
"webpack:webpack-dev-server"
@TheLarkInn
TheLarkInn / grouce-webpack-all-orgs-all-repos.bash
Last active July 6, 2025 15:36
This bash script creates a gource video. Requires gource and libav (can install with brew).
#!/bin/bash
ARRAY=(
"webpack:webpack"
"webpack:example-app"
"webpack:enhanced-require"
"webpack:webpack-dev-middleware"
"webpack:enhanced-resolve"
"webpack:template"
"webpack:webpack-dev-server"
@TheLarkInn
TheLarkInn / stats.json
Created September 26, 2017 23:07
Sample webpack stats.json
This file has been truncated, but you can view the full file.
{
"errors": [],
"warnings": [],
"version": "3.6.0",
"hash": "87cd04b20883a998cc03",
"time": 283,
"publicPath": "",
"assetsByChunkName": {
"main": "main.chunk.js"
},
@TheLarkInn
TheLarkInn / stats.json
Created September 26, 2017 23:07
Sample webpack stats.json
This file has been truncated, but you can view the full file.
{
"errors": [],
"warnings": [],
"version": "3.6.0",
"hash": "87cd04b20883a998cc03",
"time": 283,
"publicPath": "",
"assetsByChunkName": {
"main": "main.chunk.js"
},
@TheLarkInn
TheLarkInn / index.js
Created November 11, 2017 08:20
benchparse.js
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');
@TheLarkInn
TheLarkInn / ProfilingPlugin.js
Last active May 12, 2018 05:27
Profiling Plugin
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 => {
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
@TheLarkInn
TheLarkInn / BomPlugin.js
Created May 24, 2018 19:32
Super primitive BomPrependingPlugin
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