1
0
Fork 0

fix(docsearch): use Preact alias in Babel config

This commit is contained in:
François Chalifour 2020-07-21 10:29:47 +02:00
parent ba323140dc
commit 4acf723bec
2 changed files with 14 additions and 12 deletions

View file

@ -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',
},
},
],
],
};
};

View file

@ -1,5 +1,4 @@
import json from '@rollup/plugin-json';
import alias from '@rollup/plugin-alias';
import { sharedPlugins } from '../autocomplete-core/rollup.config';
@ -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],
};