Skip to content

Instantly share code, notes, and snippets.

@rschristian
rschristian / preact-hoisted.mjs
Created June 7, 2025 22:25
Comparison of `preact.mjs` w/ hoisting of `null` & `undefined`
var n, t, i, r, f, e, o, u, c, s, a, h = null,
l = void 0,
p = {},
y = [],
v = Array.isArray,
w = y.slice,
d = Object.assign;
function _(n) {
n && n.parentNode && n.remove()
@rschristian
rschristian / preact.config.js
Created October 24, 2022 13:57
Preact-CLI config to disable CSS modules
export default (config, env, helpers) => {
const { loader: cssLoader } = helpers.getLoadersByName(config, 'css-loader')[0];
cssLoader.options.modules = false;
}
@rschristian
rschristian / index.js
Created February 18, 2022 20:00
Styled Components SSR
import './style';
import App from './components/app';
let wrapper;
if (process.env.SSR) {
wrapper = (App) => {
const { ServerStyleSheet, StyleSheetManager } = require('styled-components');
const sheet = new ServerStyleSheet();
@rschristian
rschristian / stats.html
Created May 27, 2021 05:13
Output for `rollup-plugin-visualizer`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>RollUp Visualizer</title>
<style>
:root {
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,