fix(docsearch): use Preact alias in Babel config
This commit is contained in:
parent
ba323140dc
commit
4acf723bec
2 changed files with 14 additions and 12 deletions
|
|
@ -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',
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue