This repository was archived by the owner on Sep 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Gulp
Nicolas Gomes De Oliveira edited this page Dec 22, 2016
·
1 revision
#Gulp
Gulp helps us to automate tasks about our assets, like minifying css or js files, for exemple. In order to do that, you have to modify or create functions in the /gulpfile.js.
##Using existing functions
It is extremely simple to use gulp functions, you only have to enter the command in your console :
gulp <command_name>
There are actually 3 useful commands :
- gulp : this command will minify all css and js files, copy the necessary fonts and compile scss files, and create new files in /web/assets
- gulp clean : this command will erase the /web/assets directory, in case you need to do some tests
- gulp watch : this command will watch for changes in the scss files, and automatically compile them if it detects changes
###Add new files to minify/compile/watch
You can simply add to the paths object new files.
##Create new functions If you want to create new functions, in order to, for exemple, compress images, please follow those steps :
- Find the right plugin here
- Use this console command :
npm install <gulp_plugin> --save-dev - Create a new var at the top of gulpfile.js :
var <plugin> = require('<gulp-plugin>'); - Create a new task :
gulp.task('<task_name>', function(){
}- Use your plugin following its documentation
Made by the Wild Code School Lyon students