-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
33 lines (33 loc) · 1022 Bytes
/
babel.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
require.resolve('@docusaurus/core/lib/babel/preset'),
[
'taro',
{
framework: 'react',
ts: true,
},
],
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
['import', { libraryName: 'lodash', libraryDirectory: '', camel2DashComponentName: false }, 'import lodash'],
[
'import',
{ libraryName: 'react-use', libraryDirectory: 'esm', camel2DashComponentName: false },
'import react-use',
],
[
'import',
{
libraryName: '@tarojsx/ui',
libraryDirectory: 'dist',
camel2DashComponentName: false,
transformToDefaultImport: false,
},
'import @tarojsx/ui',
],
],
}