Basic starter kit for web development. No additional libraries added to simplify set up. Just add your favorite ones in the adequate folder.
- Project description.
- Tecnologies and languages used in this project.
- Basic setup: Intsalling Node, Gulp.
- Gulp usage.
- Folder structure.
- Task list Gulp.
This project is meant to be used as a starting point, like a starter kit. It's basically designed for static web development. It doesn't come with any extra libraries. Just add the minified files of the libraries you want to use on the adequate folder and start using them, no necessity to manually add links to your html. Not adding any library by default was a meditated decision I made since I could have implemented bower for all web dependencies but every project require different libraries.
As for technologies as I said I did not choose any framework or library but for styles I opted for Stylus. In addition as a build system I've chosen Gulp.js.
Get this project via: Clone this repository or Download ZIP.
- Install
io.js
/Node.js
. - Install
gulp.js
by runningnpm install --global gulp
on the terminal. - Within your terminal navigate where the project is located.
- Run
npm install
to install all the dependencies.
While developing just use gulp watch
. This task will:
- Convert any .styl into .css.
- Injects every .css and .js file path into the index.html.
- Automatically adds every photo in the distribution folder.
When everything is ready to ship use gulp build
. This task will:
- Concat all .css files into one and perform other tasks.
- Concat all .js files into one and perform other tasks.
- Automatically update paths of the index.html.
.
├── src
| ├── stylus
| ├── css
| | └── vendor
| ├── js
| | └── vendor
| └── images
├── node_module
└── index.html
Next the description of every gulp task in this project:
replace
: Changes paths in the html for the buil version.paths
: Automaically updates paths of index.html.images
: Copies images into the build folder.styles:dev
: Convert .styl files into .css and apply autoprefixer process to it.styles:build
: Concat all styles and applies:- shorthand: makes your CSS files lighter and more readable.
- csscomb: sorting CSS properties in specific order.
- csso: minimize css.
scripts:build
: Concats all .js files and applies:- uglify: compresses code.
- header: adds a header to the file.