Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vite] Missing common babel plugin(s) #11

Open
o-alexandrov opened this issue Apr 7, 2024 · 0 comments
Open

[vite] Missing common babel plugin(s) #11

o-alexandrov opened this issue Apr 7, 2024 · 0 comments
Assignees
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite

Comments

@o-alexandrov
Copy link

o-alexandrov commented Apr 7, 2024

Steps to reproduce

  1. Use barrel files import * as something from "example.ts"
    • it's easier to reproduce with Storybook, as it just doesn't start in Storybook, even if barrel files are not related to files where pigment is used
  2. See bug in CLI related to babel's transformation of namespaces

Current behavior

Currently, you must pass to the vite plugin:

pigment({
  babelOptions: {
    plugins: [`@babel/plugin-transform-export-namespace-from`],
  },
})

Expected behavior

The babel plugin @babel/plugin-transform-export-namespace-from should be added by default.
In:
https://github.com/mui/material-ui/blob/f3cb496c999acbc8f19533e38df20be12e56d059/packages/pigment-css-vite-plugin/src/vite-plugin.ts#L194

Context

Related issues:

Your environment

npx @mui/envinfo

  System:
    OS: macOS 14.4
  Binaries:
    Node: 21.7.1 - /opt/homebrew/bin/node
    npm: 10.5.0 - /opt/homebrew/bin/npm
    pnpm: 8.15.5 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 123.0.6312.87
    Edge: 112.0.1722.39
    Safari: 17.4
  npmPackages:
    @pigment-css/react: 0.0.5
    @pigment-css/vite-plugin: 0.0.5
    @emotion/react:  11.11.4 
    @emotion/styled:  11.11.5 
    @mui/styled-engine:  6.0.0-alpha.1
    @mui/system:  6.0.0-alpha.1
    @mui/types:  7.2.14 
    @types/react: 18.2.73 => 18.2.73 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: 5.4.3 => 5.4.3 

Search keywords: pigment barrel

@o-alexandrov o-alexandrov added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 7, 2024
@o-alexandrov o-alexandrov changed the title [pigment-css][vite] missing common babel plugins & extremely slow [pigment-css][vite] missing common babel plugin(s) & extremely slow Apr 7, 2024
@oliviertassinari oliviertassinari changed the title [pigment-css][vite] missing common babel plugin(s) & extremely slow [pigment-css][vite] missing common babel plugin(s) Apr 14, 2024
@oliviertassinari oliviertassinari transferred this issue from mui/material-ui Apr 14, 2024
@danilo-leal danilo-leal changed the title [pigment-css][vite] missing common babel plugin(s) [vite] Missing common babel plugin(s) Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite
Projects
None yet
Development

No branches or pull requests

3 participants