Skip to content

Commit

Permalink
fix(build): remove occurences of process in UMD build (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Sep 20, 2021
1 parent 430cbf2 commit 20f54c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
12 changes: 11 additions & 1 deletion packages/docsearch-js/rollup.config.js
@@ -1,3 +1,5 @@
import replace from '@rollup/plugin-replace';

import { plugins } from '../../rollup.base.config';
import { getBundleBanner } from '../../scripts/getBundleBanner';

Expand Down Expand Up @@ -26,5 +28,13 @@ const output = {
export default {
input: 'src/index.ts',
output: output[process.env.BUILD],
plugins,
plugins:
process.env.BUILD === 'umd'
? [
...plugins,
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
]
: plugins,
};
9 changes: 8 additions & 1 deletion packages/docsearch-react/rollup.config.js
@@ -1,3 +1,5 @@
import replace from '@rollup/plugin-replace';

import { plugins } from '../../rollup.base.config';
import { getBundleBanner } from '../../scripts/getBundleBanner';

Expand All @@ -17,5 +19,10 @@ export default {
name: pkg.name,
banner: getBundleBanner(pkg),
},
plugins,
plugins: [
...plugins,
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
],
};

0 comments on commit 20f54c9

Please sign in to comment.