title: @babel/preset-react in next.config.js is not loaded with babel-loader
body: <p>My webpack is not transpiling my jsx (and perhaps styled-components) properly so I think that babel is not being run correctly! I'm not sure if it's the styled-components that aren't working or if it's straight react.</p>
  <p>I am getting <strong>SyntaxError: Unexpected token '&lt;'</strong></p>
  <p><strong>next.config.js</strong></p>
  <pre><code>module.exports = withImages({
    publicRuntimeConfig: {
      ...config,
    },
    webpack: (config, { isServer }) =&gt; {
      config.plugins.push(
        new CopyWebpackPlugin([
          {
            from: path.join(
              __dirname,
              process.env.ENV !== 'production'
                ? 'favicons/staging/favicon.ico'
                : 'favicons/production/favicon.ico',
            ),
            to: path.join(__dirname, 'public/favicon.ico'),
          },
          {
            from: path.join(
              __dirname,
              process.env.ENV !== 'production'
                ? 'favicons/staging/favicon'
                : 'favicons/production/favicon',
            ),
            to: path.join(__dirname, 'public/favicon/'),
          },
        ]),
      )
  
      config.module.rules.push({
        test: /\.js$/,
        use: [
          {
            loader: 'babel-loader',
            options: {
              presets: ['next/babel', '@babel/preset-env', '@babel/preset-react'],
              plugins: [
                'babel-plugin-styled-components',
                &quot;@babel/plugin-proposal-export-default-from&quot;,
                &quot;@babel/plugin-proposal-export-namespace-from&quot;,
                [
                  &quot;babel-plugin-root-import&quot;,
                  {
                    &quot;paths&quot;: [
                      {
                        &quot;rootPathPrefix&quot;: &quot;~&quot;,
                        &quot;rootPathSuffix&quot;: &quot;&quot;
                      }
                    ]
                  }
                ],
                [&quot;@babel/plugin-proposal-decorators&quot;, { &quot;legacy&quot;: true }],
                [&quot;@babel/plugin-proposal-class-properties&quot;, { &quot;loose&quot;: true }]
              ],
            },
          },
        ],
      })
  
      return config
    },
  })
  </code></pre>