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:
@@ -27,7 +27,7 @@
|
||||
"keywords": [
|
||||
"rrweb"
|
||||
],
|
||||
"main": "lib/rrweb-all.js",
|
||||
"main": "lib/rrweb-all.cjs",
|
||||
"module": "es/rrweb/packages/rrweb/src/entries/all.js",
|
||||
"unpkg": "dist/rrweb.js",
|
||||
"sideEffects": false,
|
||||
|
||||
@@ -186,7 +186,7 @@ for (const c of baseConfigs) {
|
||||
output: [
|
||||
{
|
||||
format: 'cjs',
|
||||
file: c.pathFn('lib/rrweb.js'),
|
||||
file: c.pathFn('lib/rrweb.cjs'),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user