Team GoTo uses Gulp to get Sass and other NPM plugins that improves our front end workflow.
Following setup instructions is general and may differ slightly for some of our projects.
See project’s gulpfile.js instructions if you encounter any issues during setup.
Install Node and Gulp
- Download and install Node.js from http://nodejs.org to get NPM (if you don’t already have it).
- Install Gulp globally:
npm install -g gulp
Note: Make sure that /usr/local/bin is in your $PATH by following command: echo $PATH
- Go to current projects _build folder, e.g. skin/frontend/carbon/[theme_name]/_build/
- Install and/or update plugins listed in package.json file:
- Go to current project’s build folder, e.g. skin/frontend/carbon/[theme_name]/_build/
- Start using Sass:
gulp (alt. gulp watch)
Note: Make sure to add both the Sass file and the compiled CSS file to the theme’s repository
Use Browser Sync (and Live Reload)
- Server settings:
- Open MAMP Main Window
- Go to tab Hosts
- Create new host
- Server name: <project_name>.dev
- Document root: Sites/<project_name>/htdocs
- Database settings:
- Start browser sync (and watching Sass files):
gulp browser (alt. gulp sass-sync)