简体   繁体   English

Expo react native 不使用 babel.config.js 中定义的插件

[英]Expo react native not using plugin defined in babel.config.js

So I am using minimal workflow with Typescript and I have this in babel.config.js ,所以我在 Typescript 中使用了最少的工作流程,并且在babel.config.js有这个,

module.exports = function (api) {
    api.cache(true)
    return {
        presets: ["babel-preset-expo"],
        plugins: [
            [
                "module-resolver",
                {
                    root: ["."],
                    alias: {
                        "lib/": "./"
                    }
                }
            ]
        ]
    }
}

As you can see I am using babel-plugin-module-resolver to alias path.如您所见,我正在使用babel-plugin-module-resolver来别名路径。 But it's not working at all.但它根本不起作用。 What am I doing wrong here?我在这里做错了什么?

I needed to clear cache.我需要清除缓存。 yarn ios -- -c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 api.cache(true)在Expo的babel.config.js中做什么? - What does api.cache(true) do in Expo's babel.config.js? 让 Nextjs 忽略 babel.config.js - Make Nextjs to ignore babel.config.js 如何将 @babel/preset-react 添加到 babel.config.js 的预设部分 - How do I add @babel/preset-react to the presets section of babel.config.js 我可以在一个 monorepo 中有多个 babel.config.js 吗? - Can I have multiple babel.config.js in a monorepo? React Native babel 插件错误 - React Native babel plugin errors 如何使用 expo 安装和配置 react-native-sass-transformer - how to install and config react-native-sass-transformer using expo 尝试在 nextjs 应用程序中添加 `babel.config.js` 时出现`Cannot find module '.next\server\pages-manifest.json'` 错误 - Getting `Cannot find module '.next\server\pages-manifest.json'` error when trying to add `babel.config.js` in nextjs app 带有React Native的Babel插件(babel-plugin-module-alias) - Babel plugin (babel-plugin-module-alias) with React Native 在 babel.config.js 中包含 node_modules 时,当前未启用对实验语法 'jsx' 的支持 - Support for the experimental syntax 'jsx' isn't currently enabled when including node_modules in babel.config.js 使用 babel-plugin-react-native-web 从 React Native 组件捆绑 web 时出错 - Error when bundling for web from a React Native component using babel-plugin-react-native-web
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM