我是否有任何解决方案可以让我在我的服务器上工作而不需要连接SSH和写gulp js:watch sass:watch
?
这是我目前的gulpconfig.js
var gulp = require('gulp');
var sass = require('gulp-sass');
var sassGlob = require('gulp-sass-glob');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('js:build', function() {
gulp.src('js/*.js')
.pipe(concat('functions.js'))
.pipe(uglify())
.pipe(gulp.dest('./js/'))
});
gulp.task('js:watch', function() {
gulp.watch('js/*.js', ['js:build'])
});
gulp.task('sass:build', function () {
return gulp
.src('css/global.scss')
.pipe(sassGlob())
.pipe(sass())
.pipe(gulp.dest('css'));
});
gulp.task('sass:watch', function() {
gulp.watch('css/**/*.scss', ['sass:build'])
});
答案 0 :(得分:0)
linux的屏幕程序正是您所需要的:
screen -dR
CTRL-A, d
Run a command in a shell and keep running the command when you close the session
答案 1 :(得分:0)
您可以通过附加&
//pointing to startMyWebsite.sh
./startMyWebsite &