Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metro.config.js 配置多个 babelTransformerPath #349

Open
chenwf1990 opened this issue Apr 1, 2024 · 1 comment
Open

metro.config.js 配置多个 babelTransformerPath #349

chenwf1990 opened this issue Apr 1, 2024 · 1 comment

Comments

@chenwf1990
Copy link

配置postcss-transformer.js和 react-native-svg-transformer 会冲突么。具体怎么配置

@DarrenOne
Copy link

your can try mergeConfig(...configs)

const { mergeConfig } = require('metro-config');
const YourMergedConfig = mergeConfig(
 {
  transformer: {
    babelTransformerPath: require.resolve('./postcss-transformer.js'),
  }, {
  transformer: {
    babelTransformerPath: require.resolve('react-native-svg-transformer'),
  },
);

Metro Merging Configurations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants