I'm trying to use a third party JS file to add Feather Icons [ Git Repository ] to my site. If I just add the JS separately I'm able to use the icons. However, when I add them to the webpack bundle
import { feather } from 'feather-icons';
and try to call the function with feather.replace()';
I get the following error
Uncaught ReferenceError: feather is not defined
I see the JS added to bundle, but I can't seem to access it. Any ideas on how to do this?
Hi @CGTS
See the Feather main file. There is no feather exported.
Please use:
import { icons } from 'feather-icons';
Also to see what their in in a package, you can use:
import * as library from 'feather-icons';
console.log(library);
That was it. Thank you.
Thank you for this! After two year still useful!
Most helpful comment
Hi @CGTS
See the Feather main file. There is no
featherexported.Please use:
Also to see what their in in a package, you can use: