Skip to content

Internet Explorer ES6 function not compiled #1457

Closed
@tomtom94

Description

@tomtom94

Describe the bug
Internet Explorer ES6 function not compiled, which comes from socket.io-parser module a dependency of socket.io-client.

Capture d’écran 2021-04-01 à 08 31 51

I have been trying to force the compilation for this specific module, but babel-loader can't reach it because I am not making a straight ES6 import of socket.io-parser in my pages.
import parser from 'socket.io-parser' otherwise I would have compiled this module easily :) But I need you to do it for me. And get a top notch module 🥇

function excludeNodeModulesExcept(modules) {
  var pathSep = path.sep
  if (pathSep == '\\')
    // must be quoted for use in a regexp:
    pathSep = '\\\\'
  var moduleRegExps = modules.map(function(modName) {
    return new RegExp('node_modules' + pathSep + modName)
  })

  return function(modulePath) {
    if (/node_modules/.test(modulePath)) {
      for (var i = 0; i < moduleRegExps.length; i++) if (moduleRegExps[i].test(modulePath)) return false
      return true
    }
    return false
  }
}

webpackRule = [
    {
      test: /\.(js|jsx|ts|tsx)$/,
      exclude: excludeNodeModulesExcept(['query-string', 'socket.io-parser']),
      loader: 'babel-loader'
    }
]

Expected behavior
I want the javascript bundles to run on Internet Explorer 11, as simple as that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions