Herramientas de usuario

Herramientas del sitio


wiki2:webdev

¡Esta es una revisión vieja del documento!


Web development tools

Node

Install module & save it as dependence

$ npm install <module> --save

Install module & save it as a dev dependence

$ npm install <module> --save-dev

Gulp

Basic script (gulpfile.js)

var gulp = require('gulp');

gulp.task('default', function() {
  // place code for your default task here
});

Execute it:

$ gulp

If there was not a default but, for ex., deploy:

$ gulp deploy

Indicate src and dest folders

var gulp = require('gulp')

gulp.task('deploy', function () {
    return gulp.src('app/*.js')
        .pipe(gulp.dest('dist'));
});

:!: remember to return so there was another task which depended of this could use it

Add another command to execute prior to the current

gulp.task('deploy', ['prior-task1', 'prior-task2'], function () { ...

Tools for web development

Automatically reload static pages

With reload installed you can do reload -b into your root path an it will automatically reload when some of its inner files change.

wiki2/webdev.1555147485.txt.gz · Última modificación: 2020/05/09 09:25 (editor externo)