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

unable resolve module ant-mobile/lib/notice-bar/style/css #684

Closed
cooperding opened this issue Dec 27, 2016 · 2 comments
Closed

unable resolve module ant-mobile/lib/notice-bar/style/css #684

cooperding opened this issue Dec 27, 2016 · 2 comments

Comments

@cooperding
Copy link

本地环境

使用react-native-cli命令,构建的项目。此项目是ios、安卓应用。

  • antd-mobile 版本:0.9.13
  • 浏览器 (或标明是 react-native) 及其版本:0.39
    已设置

"plugins": [
[
"import", {"style": "css","libraryName": "antd-mobile"}
]
]

问题1、如何配置resolve?
问题2、import {NoticeBar} from 'antd-mobile';这种方式引入,提示错误:unable resolve module ant-mobile/lib/notice-bar/style/css.
如果使用import NoticeBar from 'antd-mobile/lib/notice-bar/index';测运行正常。
建议官方构建工具不要那么复杂,既然是以UI为主,仅可以基于react生态系统构建简单的配置。antd-mobile拆分为H5,和mobile(ios+安卓)。方便开发。

@silentcloud
Copy link
Contributor

silentcloud commented Dec 28, 2016

步骤:

  1. react-native init
  2. npm install antd-mobile@xxx -S
  3. npm install babel-plugin-import -SD
  4. add "plugins": [["import", { "libraryName": "antd-mobile" }]] to .babelrc file

另外 0.9.x 的 antd-mobile 用 0.34 的 RN 版本

https://github.com/ant-design/ant-design-mobile/blob/master/docs/react/introduce.zh-CN.md#安装

至于你提及的拆分,欢迎来这里讨论 #602

@lock
Copy link

lock bot commented May 28, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants