LoginSignup
1
1

More than 5 years have passed since last update.

【gulp】livereloadxを実行する

Last updated at Posted at 2015-02-09

gulpから黒画面のコマンドを叩いて実行

gruntでlivereloadxを実行ってのはあったけど、gulpはなかったので載せてみた。

gulpfile.js
var gulp = require('gulp'),
    exec = require('child_process').exec;

gulp.task('livereloadx', function(){
    exec('livereloadx -s -p 8000');
});

gulp.task('livereloadx', ['livereloadx']);

最低限必要な記述。
node.js,livereloadx,gulpは別途コマンドラインでインストールしておいてください。
child_processを使うことで、gulpから黒画面のコマンドを叩いて実行させることが出来ます。

gulpfile.jsが存在するディレクトリでlivereloadxコマンドが実行されるので、
ルートディレクトリを変更したい場合は適宜コードを修正してください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1