Skip to content

Commit c06efc6

Browse files
carlobeltramediegomura
authored andcommitted
Polyfill Buffer in our own code
This instance will only appear when including a font in the pdf
1 parent 451b58a commit c06efc6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/font/rollup.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import babel from '@rollup/plugin-babel';
22
import replace from '@rollup/plugin-replace';
33
import pkg from './package.json';
4+
import nodePolyfills from 'rollup-plugin-polyfill-node'
45

56
const cjs = {
67
format: 'cjs',
@@ -54,6 +55,9 @@ const getPlugins = ({ browser }) => [
5455
BROWSER: JSON.stringify(browser),
5556
},
5657
}),
58+
...(browser ? [
59+
nodePolyfills({ include: [ /\/font\/src\/.*\.js/, /polyfill/ ] }),
60+
] : []),
5761
];
5862

5963
const serverConfig = {

0 commit comments

Comments
 (0)