stylex icon indicating copy to clipboard operation
stylex copied to clipboard

Babel plugin is not compatible with @babel/preset-env

Open tmeindle opened this issue 4 months ago • 9 comments

Describe the issue

When using rollup plugin, stylex.css stops being output when @babel/preset-env is added to a babel config in root directory

Expected behavior

If the plugin is supposed to be compatible with @babel/preset-env, I would expect the stylex.css to still be output after adding @babel/preset-env

Steps to reproduce

  1. Use rollup-example as a starting point (I copied this folder out of npm workspace).
  2. Add the latest versions of rollup, @babel/cli, @babel/core, @babel/preset-env to package.json dependencies
  3. npm install using npm 18.15.0
  4. npm run build (works at this point and stylex.css is output)
  5. add a babel-config.js (or json) that includes @babel/preset-env in the presets array
{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "18"
        }
      }
    ]
  ]
}

And then styles stop working. Seems any other plugins or presets works but the minute I add preset-env no styles are generated

Test case

No response

Additional comments

No response

tmeindle avatar Jan 30 '24 20:01 tmeindle