Transforms XRegexp constructor calls to valid ES5 regular expressions.
npm install xregexp-loader
Add this to your webpack.config.js to apply the logic to your .js
files, for example.
module.exports = {
...
module: {
rules: [
{ test: /\.js$/, loader: "babel-loader!xregexp-loader" }
]
}
...
};