Why do I configure babel-loader, on webpackp but report an error when I use the extension operator? Or how can the extension operator be rewritten to look like es5?

this is the configuration in webpack:

{

            test: /\.jsx$/,
            exclude: /(node_modules)/,
            use: {
                loader: "babel-loader",
                options: {
                    presets: ["env", "react"]
                }
            }
        },

The

extension operator can be replaced with apply .

should work without being compiled by babel , because modern browsers already support ES6.

is this a mistake reported by the editor, that is, grammar checking?


configure .babelrc

Menu