Installing Grunt for Magento 2

1. Install node and npm

apk add --update --no-cache nodejs nodejs-npm

2. Install grunt

npm install -g grunt-cli

3. Rename the Grunt files

mv /grunt-config.json.sample /grunt-config.json  
mv /Gruntfile.js.sample /Gruntfile.js.sample

4. Create a local-themes.js file for your custom themes

mv /dev/tools/grunt/configs/themes.js /dev/tools/grunt/configs/local-themes.js

5. Now we can clean the static files

grunt clean

6. Compile

grunt exec:all

7. Watch for changed files

grunt watch:all

 

Gareth
Buy Me A Coffee
back arrowBack to Index