Gulp is used to compile SCSS to css files. Gulp is a npm package and you need to install npm modules to use it.
You have to install those modules to be able to compile.
You need to install Gulp globally to be able to use the gulp command
npm install -g gulp
Yarn is a npm package which "replace" the npm package manager. It supports cache and faster installations.
npm install -g yarn
When Yarn is installed
In the terminal, go to the root of the project and run the command: yarn
This will install all necessary packages and when it is done, you can start compiling.
If you want the gulp command to run everytime you change a SCSS file, you run gulp watch:
If you want the browser to reload itself when a change is made you add a --proxy:
gulp watch --proxy=path
gulp watch --proxy=mysite.dev
Use virtualhost to create a nice readable hostname to your project.
If you want to minify all the CSS code into one file you use:
This can also be combined with the other command options.
Remember if you want to run production mode you have to go into inc/config.php and change devMode to false. Else then production compiled CSS/JS will not be used.
If it doesn't work as you expect, make sure you the gulpfile.js have the correct setup.
When the site will be public, you want it to be in a production mode. Be sure to do these steps when this is about to happened.
- devMode = false
- display_errors = Off
- Make sure all the image paths are correct. Be sure that the image paths are not linked to your local installation. They should always be relative to the root which is often "/". Example src="/uploads/image.jpg" And not src="http://mysite.dev/uploads/image.jpg"
- Make sure the MX Entry has correct setup in the Cpanel. If the system email is owned by the server the site is installed at, the MX Entry should be Local else if the email is located on an external server, the MX Entry should be Remote