其他浏览器即使在边缘也能正常工作。
我尝试过使用“core.js”、“babel polyfills”、“babel插件转换类属性”。
// webpack v4
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, '/dist'),
filename: 'index_bundle.js',
publicPath: '/',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.styl$/,
exclude: /node_modules/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'stylus-loader'],
}),
},
{
test: /\.(png|jp(e*)g|svg|woff|woff2|eot|ttf|otf)$/,
use: [{
loader: 'url-loader',
options: {
limit: 8000, // Convert images < 8kb to base64 strings
name: 'images/[hash]-[name].[ext]',
},
}],
},
],
},
devServer: {
port: 8881,
host: '0.0.0.0',
historyApiFallback: true,
},
watch: true,
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
}),
new ExtractTextPlugin(
{ filename: 'app.bundle.css' },
),
],
};
我尝试了以下问题的解决方案,但这些问题对我没有帮助:
react with IE11 is not working, displaying blank screen
IE11 throwing âSCRIPT1014: invalid characterâ where all other browsers work