fix: module error (#1087)

* fix: module error

refactor all suffix of bundled scripts with commonjs module from 'js' to cjs

error:
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '.../rrweb/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

* update jest config files
This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent eca872e78f
commit 80ca04ddd6
8 changed files with 11 additions and 8 deletions

View File

@@ -37,7 +37,7 @@
"lint": "yarn eslint src/**/*.ts"
},
"description": "rrweb's replayer UI",
"main": "lib/index.js",
"main": "lib/index.cjs",
"module": "dist/index.mjs",
"unpkg": "dist/index.js",
"files": [
@@ -46,6 +46,7 @@
"typings"
],
"typings": "typings/index.d.ts",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/rrweb-io/rrweb.git"