Skip to content

ravbetsky/m2-grunt-spritesmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Magento2 custom grunt task

Adds grunt-spritesmith task for any M2 theme.

Usage

First you to add new dependency to your package.json

npm install grunt-spritesmith --save-dev

Than copy dev/tools/grunt/configs/sprite.js and dev/tools/grunt/tasks/sprite.js to the same directories in your Magento2 installation and open Gruntfile.js in the root directory and find something like:

[
    taskDir + '/static',
    'time-grunt'
].forEach(function (task) {
    require(task)(grunt);
});

And type following before time-grunt:

taskDir + '/sprite', // Here is our custom sprite task

Sprite task is ready for any theme which is defined at dev/tools/grunt/configs/themes.js. Before using sprite task don't forget to run php bin/magento setup:static-content:deploy

Now you can run sprite task for any theme like this:

grunt sprite:<theme_name>

License

MIT

About

This is an example of grunt task for Magento 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published