Skip to content

install

shell
npm install -g @tarojs/cli
npm install -g @react-native-community/cli

taro rn

shell
taro init

rn shell

shell
npx @react-native-community/cli init nativeShell --version 0.76.0
shell
pnpm add -D @babel/preset-env @babel/plugin-transform-runtime @babel/plugin-syntax-dynamic-import @babel/plugin-proposal-decorators

babel.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