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 in the root of your project.
-
Install the following required modules:
npm install gulp npm install gulp-less npm install gulp-util npm install chalk npm install gulp-clean npm install gulp-run
-
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], "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: locale,
files: Files to compile
-
Task watch.
gulp watch --Theme-name
-
Task clean and build.
gulp build --Theme-name
- Update Magento2 packege.json with the required modules
- Compile different languages
OSL - Open Software Licence 3.0
Irene Iaccio(@nuovecode) http://www.bitbull.it
(c) 2016 Bitbull Srl