代码之家  ›  专栏  ›  技术社区  ›  Hitesh Chaudhari

Script1014 IE11中的无效字符错误

  •  1
  • Hitesh Chaudhari  · 技术社区  · 8 年前

    其他浏览器即使在边缘也能正常工作。 我尝试过使用“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

    1 回复  |  直到 8 年前
        1
  •  0
  •   Hitesh Chaudhari    8 年前

    它解决了我的问题。