Skip to content

Instantly share code, notes, and snippets.

View PhilippMolitor's full-sized avatar
🛰️
Working on 3D printers and embedded devices

Philipp Molitor PhilippMolitor

🛰️
Working on 3D printers and embedded devices
View GitHub Profile
@PhilippMolitor
PhilippMolitor / disable-react-devtools.ts
Created August 23, 2021 00:06
Disable React Dev Tools in a safe way, with TypeScript type-safety
declare global {
interface Window {
__REACT_DEVTOOLS_GLOBAL_HOOK__?: Record<
string,
Map<any, any> | (() => any)
>;
}
}
export function disableDevTools(): void {
@PhilippMolitor
PhilippMolitor / craco.config.js
Created July 21, 2021 10:56
Fix including yarn workspaces packages in create-react-app with craco
module.exports = {
webpack: {
configure: (webpackConfig) => ({
...webpackConfig,
module: {
...webpackConfig.module,
rules: webpackConfig.module.rules.map((rule) => {
if (!rule.oneOf) return rule;
return {
...rule,