ali

antd-local-icon

A webpack loader for deploy icon files when using the antd

Showing:

Popularity

Downloads/wk

2.2K

GitHub Stars

11

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.3KB

License

GPL-3.0-or-later

Type Definitions

Tree-Shakeable

No?

Categories

Readme

antd-local-icon

A webpack loader for deploy icon files when using the antd

Usage

Note that you must import antd source instead of distribution.

  1. npm install --save-dev antd-local-icon

  2. Download the antd icon to local and place all font files in your project.

  3. Modify your webpack.config.js like following:

module.exports = {
    //... your config
    
    module: {
        loaders: [
        //... your config
            {
                test: function(abspath) {
                // extract 'index.less' in antd to load it using antd-local-icon
                    return /\.less/.test(abspath) && abspath.indexOf('antd/lib/style/index.less') == -1;
                },
                loader: "style!css!less"
            },
            {
                test: function(abspath) {
                    return abspath.indexOf('antd/lib/style/index.less') !== -1;
                },
                // the param url is your local icon files location.
                loader: "style!css!less!antd-local-icon?url=/assets/font/iconfont"
            }
        ]
    }
}

Feedback

If you have any questions or requirements, use Issues.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100