Skip to content

Commit 84d1885

Browse files
carlobeltramediegomura
authored andcommitted
fixup! Browser compatibility for renderer package
1 parent de8439c commit 84d1885

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

packages/renderer/rollup.config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ const esm = {
2727
const getCJS = override => Object.assign({}, cjs, override);
2828
const getESM = override => Object.assign({}, esm, override);
2929

30+
const nodeInput = './src/node/index.js';
31+
const domInput = './src/dom/index.js';
32+
3033
const babelConfig = ({ browser }) => ({
3134
babelrc: false,
3235
exclude: 'node_modules/**',
@@ -50,8 +53,6 @@ const babelConfig = ({ browser }) => ({
5053
],
5154
});
5255

53-
const input = './src/node/index.js';
54-
5556
const getExternal = ({ browser }) => [
5657
'@babel/runtime/helpers/extends',
5758
'@babel/runtime/helpers/objectWithoutPropertiesLoose',
@@ -81,7 +82,7 @@ const getPlugins = ({ browser, minify = false }) => [
8182
];
8283

8384
const serverConfig = {
84-
input,
85+
input: nodeInput,
8586
output: [
8687
getESM({ file: 'lib/react-pdf.es.js' }),
8788
getCJS({ file: 'lib/react-pdf.cjs.js' }),
@@ -91,7 +92,7 @@ const serverConfig = {
9192
};
9293

9394
const serverProdConfig = {
94-
input,
95+
input: nodeInput,
9596
output: [
9697
getESM({ file: 'lib/react-pdf.es.min.js' }),
9798
getCJS({ file: 'lib/react-pdf.cjs.min.js' }),
@@ -101,7 +102,7 @@ const serverProdConfig = {
101102
};
102103

103104
const browserConfig = {
104-
input,
105+
input: domInput,
105106
output: [
106107
getESM({ file: 'lib/react-pdf.browser.es.js' }),
107108
getCJS({ file: 'lib/react-pdf.browser.cjs.js' }),
@@ -111,7 +112,7 @@ const browserConfig = {
111112
};
112113

113114
const browserProdConfig = {
114-
input,
115+
input: domInput,
115116
output: [
116117
getESM({ file: 'lib/react-pdf.browser.es.min.js' }),
117118
getCJS({ file: 'lib/react-pdf.browser.cjs.min.js' }),

0 commit comments

Comments
 (0)