christopher-caldwell / vite-material-ui

A Vite starter template for React, TypeScript, and MUI
MIT License
46 stars 17 forks source link

@emotion/babel-plugin config #8

Closed kgrhartlage closed 2 years ago

kgrhartlage commented 2 years ago

IIUC your importMap configuration is no longer needed after this PR is now merged.

react({
  babel: {
    plugins: [
      [
        '@emotion',
        {
          importMap: {
            '@mui/material': {
              styled: {
                canonicalImport: ['@emotion/styled', 'default'],
                styledBaseImport: ['@mui/material', 'styled']
              }
            },
            '@mui/material/styles': {
              styled: {
                canonicalImport: ['@emotion/styled', 'default'],
                styledBaseImport: ['@mui/material/styles', 'styled']
              }
            }
          }
        }
      ]
    ]
  }
  }),

You also don't seem to have the related package in your dependencies.

Thank you for providing this template.

christopher-caldwell commented 2 years ago

Hmm, okay. I'll check it out. Thanks!