https://github.com/cncolder/antd-mobile-web
antd-mobile web only
https://github.com/cncolder/antd-mobile-web
antd-mobile javascript react react-components
Last synced: 3 months ago
JSON representation
antd-mobile web only
- Host: GitHub
- URL: https://github.com/cncolder/antd-mobile-web
- Owner: cncolder
- Created: 2017-02-22T15:08:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-22T20:04:03.000Z (about 8 years ago)
- Last Synced: 2025-05-19T11:21:26.579Z (5 months ago)
- Topics: antd-mobile, javascript, react, react-components
- Language: JavaScript
- Size: 70.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# [Experience] - Ant design mobile web entry
[antd-mobile](https://github.com/ant-design/ant-design-mobile) web only. Don't worry [.web.js](https://github.com/ant-design/ant-design-mobile/issues?utf8=%E2%9C%93&q=is%3Aissue%20.web) suffix issues.
`npm i --save-dev antd-mobile-web`
Or
`yarn add -D antd-mobile-web`
## Usage
Setup `.babelrc`
```json
{
"presets": [
"antd-mobile-web/babel"
]
}
```Setup `webpack.config.js`
```js
module.exports = {
module: {
rules: [
amwWebpack.createSvgRule()
]
}
}
```Work in progress:
**Dont forget setup `style-loader` and `css-loader` in your webpack config**Import components
```js
import { Button } from 'antd-mobile-web'
```### [Here is a full example](https://github.com/ant-design/antd-mobile-samples/tree/master/antd-mobile-web)
## Why?
Because `Cannot resolve module 'react-native'`
[antd-mobile](https://github.com/ant-design/ant-design-mobile) is a React Native first library. For web. You need import '.web.js'. Official introduce show you how to package by special [webpack config](https://github.com/ant-design/ant-design-mobile/blob/master/docs/react/introduce.md#web-使用方式). But it's not friendly in test env or editor.
## How it work
Script generate file trees sync from `antd-mobile/lib`. And point to `antd-mobile/lib/${comp}/index.web`.
## TODO
* Support style
## Acknowledgements
This project is a shell base on `antd-mobile`. Which product by Ant Design team.