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:
@@ -14,6 +14,7 @@
|
||||
"prepublish": "npm run typings && npm run bundle",
|
||||
"lint": "yarn eslint src"
|
||||
},
|
||||
"type": "module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rrweb-io/rrweb.git"
|
||||
@@ -23,7 +24,7 @@
|
||||
"snapshot",
|
||||
"DOM"
|
||||
],
|
||||
"main": "lib/rrweb-snapshot.js",
|
||||
"main": "lib/rrweb-snapshot.cjs",
|
||||
"module": "es/rrweb-snapshot.js",
|
||||
"unpkg": "dist/rrweb-snapshot.js",
|
||||
"typings": "typings/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user