(based on Una Kravets' gulp boilerplate)
What's set up here:
- Sass (LibSass)
- Autoprefixer
- CSS Minification
- JSHint
- Scss Lint (based on this config)
- HTML Minification
- BrowserSync
- Image Minification
- GH-Pages deployment from dist/ folder
- Twig Templates
- Install node and make sure npm (Node Package Manager) is also installed
- Clone this repo with
git clone https://github.com/una/gulp-starter-env <your-project-name>
to build this repo into your own project or download the zip - In terminal,
cd
(change directory) to the folder containing your project. - Run
rm -rf .git
to remove the Git file from the repo andgit init
for a clean history npm install
to download dependancies- In the terminal, enter
gulp
to make everything run - Take note of the Access URLs provided in your terminal. Your web page should pop up at
http://localhost:3000
. You can access this same page on your various devices in the same wifi network with the provided External URL. You can share the External URL with coworkers and they'll see whats on your screen. - Edit your Sass code inside of the scss folder. You can make subfolders inside of that to better organize your code. Prefix your sass files with an underscore. More info on using @import to organize your files here
- Your minified files will be automagically created and updated in
dist/
. It will create your optimized css, html, and javascript files for you. Never edit files within thedist/
folder. (Dist stands for Distribution) - Twig templates and partials are stored in
src/
and are rendered out the server docrootdist
. - Keep gulp running while you're making changes. When you want to close out of the gulp task, in the terminal, hit
ctrl + C
- Twig.js for gulp uses a subset of features from Twig for PHP. Differences are listed here