Expression expected in index.js after switching to swc-loader

159 views Asked by At

i have to change loader in my webpack.config to swc-loader and i'm using react-app-rewired, i have added the following code to config-overrides.js :

module.exports = function override(config, env) {
config.module.rules.push({
        test: /\.js$/,
        use: {
            loader: "swc-loader",
            options: {
                sync: true,
                parseMap: false,
            }
        }
    });
return config;
};

After executing npm run build i got:

Expression expected
 11 │           <React.StrictMode>
 12 │                   <BrowserRouter>
 13 │
 14 │                           <App/>
    ·     ─
 15 │
 16 │                   </BrowserRouter>
 16 │           </React.StrictMode>

Any ideas how to fix it? Ill be grateful.

0

There are 0 answers