Simple Gulpfile for Magento2
This project is originated from the need to make faster the frontend workflow of Magento 2. More info here: http://www.bitbull.it/blog/la-compilazione-del-less-in-magento2/
-
Place the gulpfile.js and the package.json in the root of your project.
-
Install the required modules:
npm install / yarn install
-
Create a configuration file dev/tools/gulp/themes.js with the following contents.
module.exports = { <Theme>: { "src": [ "vendor/<Vendor>/<Theme-name>", "vendor/<Vendor>/<Module-name>" ], "dest": "pub/static/frontend/<Vendor>/<Theme-name>", "locale": [locale,locale], "lang": "less", "area": "frontend", "vendor": <Vendor>, "name": <Theme-name>, "files": [ "css/styles-m", "css/styles-l" ] } };
src: Array of theme and modules you want to compile in format "vendor//"
dest: Path in pub/static of your theme
area: area, one of (frontend|adminhtml|doc),
name: theme name in format theme-name,
locale: array of language to compile,
files: Files to compile
-
Task watch. Watches for less changes in vendor modules/themes and compile them in pub/static..
gulp watch --Theme-name
-
Task clean. Clean old assets and run deployments commands.
gulp clean --Theme-name
-
Task clean cache. Clean cache.
gulp clean-cache --Theme-name
OSL - Open Software Licence 3.0
- 3.1.0 Compile in different locales
- 3.0.0 Added build and clean tasks
- 2.0.0 Added sourcemaps
- 1.0.0 First release
Irene Iaccio(@nuovecode) http://www.bitbull.it
(c) 2016 Bitbull Srl