webpack代码没有将const转换为var

时间:2018-08-31 18:27:45

标签: javascript node.js webpack webpack-dev-server

我的webpack不会将const转换为var,在像IE11或Safari 9这样的浏览器中,由于该原因我收到了错误,是否需要对webpack进行一些配置?

我的webpack配置:

module: {
        rules: [
            {
                test: /\.(js|jsx)$/,
                exclude: /node_modules/,
                use: {
                    loader: "babel-loader",
                    options: {
                        presets: ['es2015', 'stage-1', 'react'],
                        plugins: [
                            "transform-remove-strict-mode",
                            "transform-object-assign",
                            "transform-decorators-legacy"
                        ]
                    }
                }
            },
            {
                test: /\.(png|gif|jpe?g||eot|svg|ttf|woff|woff2|cur)$/,
                loader: "file-loader"
            }
        ]
    }

0 个答案:

没有答案