Skip to content

Commit

Permalink
fix(docsearch): use Preact alias in Babel config
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Jul 21, 2020
1 parent ba32314 commit 4acf723
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 13 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ module.exports = (api) => {
},
],
],
plugins: [['@babel/plugin-transform-react-jsx']],
plugins: [
['@babel/plugin-transform-react-jsx'],
[
'module-resolver',
{
root: ['./src'],
alias: {
react: 'preact/compat',
'react-dom': 'preact/compat',
},
},
],
],
};
};
12 changes: 1 addition & 11 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json from '@rollup/plugin-json';
import alias from '@rollup/plugin-alias';

import { sharedPlugins } from '../autocomplete-core/rollup.config';

Expand All @@ -11,14 +10,5 @@ export default {
sourcemap: true,
name: 'docsearch',
},
plugins: [
json(),
alias({
entries: [
{ find: 'react', replacement: 'preact/compat' },
{ find: 'react-dom', replacement: 'preact/compat' },
],
}),
...sharedPlugins,
],
plugins: [json(), ...sharedPlugins],
};

0 comments on commit 4acf723

Please sign in to comment.