Skip to content

Instantly share code, notes, and snippets.

@oliviertassinari
Last active May 1, 2024 21:49
Show Gist options
  • Save oliviertassinari/5e9031104a86eb5c3325819e9a23857f to your computer and use it in GitHub Desktop.
Save oliviertassinari/5e9031104a86eb5c3325819e9a23857f to your computer and use it in GitHub Desktop.
@mui/styled-engine-empty
import * as React from 'react';
export default function styled(tag = 'div', options) {
return (styles) => React.forwardRef((props, ref) => {
const { ownerState, theme, sx, as, ...other } = props;
return React.createElement(tag, { ref, ...other });
});
}
export function ThemeContext() {
}
export const keyframes = '';
export const css = () => null;
export function StyledEngineProvider() {
return null
}
export function GlobalStyles() {
return null;
}
export function internal_processStyles(tag, processor) {
}
{
"version": "0.0.1",
"name": "@mui/styled-engine-empty",
"main": "index.jsx"
}

@mui/styled-engine-empty

An empty style engine to get a sense of the performance cost of @mui/styled-engine.

Add in your package.json

  "dependencies": {
    "@mui/styled-engine-empty": "gist:5e9031104a86eb5c3325819e9a23857f"
  }

Add the alias in the Vite config:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@mui/styled-engine': '@mui/styled-engine-empty'
    },
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment