Webpack common code vendor shows that the es6 syntax has not been compiled, but other package files have been compiled

problem description

webpack common code vendor shows that the es6 syntax has not been compiled, but other package files have been compiled

related codes

/ / Please paste the code text below (do not replace the code with pictures)

{
            test: /\.jsx?$/,
            exclude: /(node_modules|bower_components)/,
            loader: "babel-loader",
            query: {
                "plugins": [["transform-decorators-legacy"], ["transform-runtime"],
            ],
                "presets" : [
                    [ "env", {
                        "modules": false
                    }],
                    "es2015",
                    "react",
                    "stage-0"
                 ]
            }
        }
 // 
    new webpack.optimize.CommonsChunkPlugin({ 
        name: "vendor", 
        filename: "js/[name].[hash:8].js"
     }),          

Picture

is the content of this and is not compiled

Apr.05,2021

some dependencies may have been dropped by your exclude, so check it out for yourself without babel-loader processing.


the new syntax will be compiled, and the new method will not change after compilation. The support of the new method depends on polyfill
and yours is obviously dropped by exclude


the difference is that there is node_modules code in vendor. Others are contained by the business code.

so check out how the js section of your webpack handles it.


solved because my vendor is packaged and the third-party components are all in the dependencies of package.json, and the code is in node_modules, and then my configuration excludes the node_modules of exclude, so the things in it are not compiled.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32f20-2be4f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32f20-2be4f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?