Search code examples
laravelgulplaravel-5laravel-elixir

Gulp File Not Copying Fonts


I am attempting to move some of my fonts over through my resources/assets/fonts/web-icons/ directory over so that when I use them in my layouts it will show the correct icons. Can someone help me understand when I run this for my gulp file it does not copy the web-icons over to the public folder which I'm trying to show as public/fonts/web-icons.

var elixir = require('laravel-elixir');

elixir(function (mix) {

    /**
     * Copy needed files from Remark directories
     * to /public directory.
     */
    mix.copy('fonts/web-icons', 'public/fonts');

    mix.styles([
        'libs/bootstrap.css',
        'libs/bootstrap-extend.css',
        'libs/animsition.css',
        'libs/asScrollable.css',
        'libs/switchery.css',
        'libs/slidePanel.css',
        'libs/flag-icon.css',
        'site.min.css'
    ]);
});

Solution

  • According to the Elixir documentation:

    The copy method may be used to copy files and directories to new locations. All operations are relative to the project's root directory

    If your fonts are stored in your resources directory, you should specify that full path as the first argument:

    mix.copy('resources/assets/fonts/web-icons', 'public/fonts/web-icons');