I bought a html/css theme and it uses this package:
https://github.com/feathericons/feather
When I run npm install feather-icons --save-dev
I get this installed under node_modules:
inside icons/ there are simply .svg files/icons
I don't get it how did the seller of this theme, create this file structure under public/fonts/feather folder out of that package???
Is there some kind of tool to generate these files out of that npm package or what???
What theme author did is correct. because you can update your icon when it's linked to NPM repository. By the way follow the steps for adding icon to your project.
feather.replace()
method in app.js
file. (If you using default Laravel Mix structure)public/js
by default so the script tag is looks like (assuming you using it in Laravel Blade)<script src="{{ asset('js/app.js') }}"></script>
<h1><i data-feather="circle"></i>Hello World</h1>
it should work fine. alternatively you can use directly by linking to CDN.
<!DOCTYPE html>
<html lang="en">
<title></title>
<script src="https://unpkg.com/feather-icons"></script>
<body>
<!-- example icon -->
<i data-feather="circle"></i>
<script>
feather.replace()
</script>
</body>
</html>
Alternatively you may use mix.copy
or mix.copyDirectory
to copy from node modules. For example
mix.copyDirectory('node_modules/feather-icons', 'public/icons');
PS: For more info https://laravel.com/docs/5.8/mix