Skip to content

Installing and using in NPM and webpack #877

Description

@Kosmin

Hi Guys, first of all thank you for an awesome repo!

Second of all I'm having some serious issues getting icons to work under npm. I've tried

import { add } from 'ionicons/icons';
import { IonIcon } from 'ionicons/dist';

...
<IonIcon icon={add} />

I know the docs say in IonicFramework to use <script src="https://unpkg.com/ionicons@5.0.0/dist/ionicons.js"></script>, but what's the alternative if I'd like to use import ... ? I'm sure it's something very simple but after looking at the source code for a few hours I'm drawing a blank. Also I've tried:

import 'ionicons/dist/ionicons.js';
...
<ion-icon name='add' />

And still nothing

Can you please help me use IonIcons in NPM with imports?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions