antd-mobile-web
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

[Experience] - Ant design mobile web entry

antd-mobile web only. Don't worry .web.js suffix issues.

npm i --save-dev antd-mobile-web

Or

yarn add -D antd-mobile-web

Usage

Setup .babelrc

{
    "presets": [
        "antd-mobile-web/babel"
    ]
}

Setup webpack.config.js

module.exports = {
    module: {
        rules: [
            amwWebpack.createSvgRule()
        ]
    }
}

Work in progress: Dont forget setup style-loader and css-loader in your webpack config

Import components

import { Button } from 'antd-mobile-web'

Here is a full example

Why?

Because Cannot resolve module 'react-native'

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

Package Sidebar

Install

npm i antd-mobile-web

Weekly Downloads

2

Version

1.5.0

License

MIT

Last publish

Collaborators

  • colder