Appearance
install
shell
npm install -g @tarojs/cli
npm install -g @react-native-community/clitaro rn
shell
taro initrn shell
shell
npx @react-native-community/cli init nativeShell --version 0.76.0shell
pnpm add -D @babel/preset-env @babel/plugin-transform-runtime @babel/plugin-syntax-dynamic-import @babel/plugin-proposal-decoratorsbabel.config.js
js
module.exports = {
presets: [
['taro', {
framework: 'react',
ts: true,
compiler: 'vite',
useBuiltIns: process.env.TARO_ENV === 'h5' ? 'usage' : false
}],
'@babel/preset-env',
'@babel/preset-react'
],
plugins: [
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-runtime',
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-proposal-decorators', { legacy: true }]
]
}shell
cd nativeShell
pnpm add -D @babel/plugin-transform-runtime