0.1.0 • Published 3 years ago
laravel-mix-icomoon v0.1.0
Laravel Mix Icomoon
Laravel Mix extension to generate icomoon fonts.
Note
Now you can put your generated Icomoon font icons in ZIP file to custom directory, extension will automatically regenerate CSS to your desire.
This extension uses Gulp 4. This can create unexpected behavior if you are using older version of Gulp inside your project.
Installation
Install the extension:
npm install laravel-mix-icomoon
Or if you prefer yarn:
yarn add laravel-mix-icomoon
Next require the extension inside your Laravel Mix config and call icomoon()
in your pipeline:
// webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-icomoon');
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.icomoon();
Options
Default options
If nothing is passed to the extension inside your Laravel Mix config, the following options will be used:
{
inputPath: 'resources/icomoon',
publicPath: 'public',
output: 'fonts/icomoon',
cssFile: 'resources/sass/_icomoon.scss',
reload: true,
debug: false
}
Option details
inputPath
(string). Your icomoon data path. Place your Icomoon generated ZIP file here.publicPath
(string). Your application's public path.output
(string). Where decompressed fonts will be saved. Relative to thepublicPath
.cssFile
(string). Path to CSS file, where icomoon fonts will be declared.reload
(boolean). Whenever to reload browser after success. I recommend having this option enabled since Laravel Mix's SASS HMR (when runningnpm run hot
) is not "perfect".debug
(boolean). Whenever to log extension events messages to the console.
New in version 0.1.x
- Now supports
laravel-mix
version 6