How to configure Twin.macro with RsPack

27 views Asked by At

I have a React JS 18 Project using webpack5 + Tailwindcss + Twin.macro for CSS in JS. I am trying to migrate to RsPack and I followed the official migration doc --> https://www.rspack.dev/guide/migrate-from-webpack.html

The issue is Twin.macro needs some babel plugins to work but those are not there in RsPack. What will be the config to include it in RsPack ?

The .babelrc file before migration from Webpack to RsPack:

  {
      "presets": [
        "@babel/preset-env",
        [
          "@babel/preset-react",
          {
            "runtime": "automatic"
          }
        ],
        "@emotion/babel-preset-css-prop",
        "@babel/preset-typescript"
      ],
      "plugins": ["babel-plugin-twin", "babel-plugin-macros","@babel/plugin-transform-runtime"]
  }

0

There are 0 answers

Related Questions in TWIN.MACRO

Related Questions in RSPACK