diff --git a/docs/recipes/optimize-storage.md b/docs/recipes/optimize-storage.md index 55e3dd0fad..5ae914762b 100644 --- a/docs/recipes/optimize-storage.md +++ b/docs/recipes/optimize-storage.md @@ -66,7 +66,7 @@ rrweb.record({ ### Use packFn to compress every event -rrweb provides a pako-based simple compress function rrweb.pack. +rrweb provides an fflate-based simple compress function rrweb.pack. You can use it by passing it as the `packFn` in the recording. diff --git a/docs/recipes/optimize-storage.zh_CN.md b/docs/recipes/optimize-storage.zh_CN.md index d982cfd100..6d04434677 100644 --- a/docs/recipes/optimize-storage.zh_CN.md +++ b/docs/recipes/optimize-storage.zh_CN.md @@ -66,7 +66,7 @@ rrweb.record({ ### 基于 packFn 的单数据压缩 -rrweb 内包含了基于 pako 的简单压缩 rrweb.pack,在录制时可以作为 `packFn` 传入。 +rrweb 内包含了基于 fflate 的简单压缩 rrweb.pack,在录制时可以作为 `packFn` 传入。 ```js rrweb.record({ diff --git a/rollup.config.js b/rollup.config.js index d2b49958d6..53d2d48624 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,5 +1,4 @@ import typescript from 'rollup-plugin-typescript'; -import commonjs from 'rollup-plugin-commonjs'; import resolve from 'rollup-plugin-node-resolve'; import { terser } from 'rollup-plugin-terser'; import postcss from 'rollup-plugin-postcss'; @@ -37,12 +36,6 @@ function toMinPath(path) { return path.replace(/\.js$/, '.min.js'); } -const namedExports = { - 'pako/dist/pako_deflate': ['deflate'], - 'pako/dist/pako_inflate': ['inflate'], - pako: ['deflate'], -}; - const baseConfigs = [ // record only { @@ -85,7 +78,7 @@ const baseConfigs = [ let configs = []; for (const c of baseConfigs) { - const basePlugins = [resolve(), commonjs({ namedExports }), typescript()]; + const basePlugins = [resolve({ browser: true }), typescript()]; const plugins = basePlugins.concat( postcss({ extract: false, @@ -154,9 +147,6 @@ if (process.env.BROWSER_ONLY) { input: './src/index.ts', plugins: [ resolve(), - commonjs({ - namedExports, - }), typescript(), postcss({ extract: true, diff --git a/src/declarations/pako/index.d.ts b/src/declarations/pako/index.d.ts deleted file mode 100644 index e92682ac15..0000000000 --- a/src/declarations/pako/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module 'pako/dist/pako_deflate' { - export const deflate: any; -} - -declare module 'pako/dist/pako_inflate' { - export const inflate: any; -} - -declare module 'pako' { - export const deflate: any; - export const inflate: any; -}