rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

How can I use Babel to convert RRWeb to IE11 code?

Open wangding-2020 opened this issue 7 months ago • 0 comments

How to use Babel to convert rrweb into code that supports IE11 environment? The document states that rrweb does not support IE11 and below. IE11 is supported, but there is no specific explanation. I always encounter problems when using babel conversion here, and I cannot run it even after imitating some babel IE11 examples. Can you provide example code for converting babel to IE11 support in the official document Here is my Babel configuration:

module.exports = api => { api.cache(true) return { plugins: [ ["@babel/plugin-proposal-decorators",{"decoratorsBeforeExport":true}], ], presets: [ [ "@babel/preset-env", { modules: 'auto', targets: { ie: "11" },

        useBuiltIns: "usage",
        corejs: 3
	}
    ]
]
}

} package.json: "dependencies": { "core-js": "^3.41.0" }, "devDependencies": { "@babel/cli": "^7.14.5", "@babel/core": "^7.14.6", "@babel/plugin-proposal-decorators": "^7.14.5", "@babel/plugin-transform-runtime": "^7.12.17", "@babel/preset-env": "^7.12.17", "@babel/runtime": "^7.14.6", "babel-loader": "^8.2.2", "css-loader": "^5.0.2", "html-loader": "^2.1.0", "html-webpack-plugin": "^5.2.0", "sass": "^1.32.8", "style-loader": "^2.0.0", "webpack": "^5.39.1", "webpack-cli": "^4.7.2", "webpack-dev-server": "^5.2.0" }, "scripts": { "build": "babel src/rrweb.umd.js" }

Run command:npm run build -- -d dist

The above is just one of my configurations. I have tried it multiple times, and the best one was that there were no syntax errors. IE11 runs normally, but when I start recording, it will prompt that the proxy is undefined or something like that. Please forgive me for not being very good at this aspect. Thank you! Thank you

wangding-2020 avatar Mar 03 '25 02:03 wangding-2020