vitejs / vite-plugin-react-swc

Speed up your Vite dev server with SWC
MIT License
825 stars 54 forks source link

how to config transform #93

Closed eightHundreds closed 1 year ago

eightHundreds commented 1 year ago
// .swcrc
[
    {
      "test": ".tsx?$",
      "jsc": {
        "parser": {
          "syntax": "typescript",
          "tsx": true,
          "decorators": false,
          "dynamicImport": true
        },
        "transform": {
          "react": {
            "throwIfNamespace": false
          }
        }
      }
    },
]

this is no work

ArnaudBarre commented 1 year ago

Yeah this is not configurable. What is missing for you?

nsaunders commented 1 month ago

It would be great to be able to configure "throwIfNamespace": false. As far as I can tell, React supports JSX namespaces at least as far back as v17.

ArnaudBarre commented 4 weeks ago

Can you provide an example usage via stackblitz with the Babel version? I'm never encounter them. If this is something, maybe you should ask to change the default in SWC