diff --git a/babel.config.js b/babel.config.js index ec916c22..a614d94d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -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', + }, + }, + ], + ], }; }; diff --git a/rollup.config.js b/rollup.config.js index e36fda13..05d3f3c9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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], };