-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #7427 Use `gulp dev` to start development mode. Starts ember build and does livereload for client and server changes. Use `gulp server` to start server development mode. Doesn't start ember build and livereloads for server changes only.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var gulp = require('gulp'), | ||
livereload = require('gulp-livereload'), | ||
nodemon = require('gulp-nodemon'), | ||
shell = require('gulp-shell'), | ||
chalk = require('chalk'), | ||
paths, | ||
nodemonServerInit; | ||
|
||
paths = { | ||
server: 'core/server/', | ||
client: 'core/client/' | ||
}; | ||
|
||
nodemonServerInit = function () { | ||
livereload.listen(); | ||
|
||
return nodemon({ | ||
script: 'index.js', | ||
ext: 'js,json,hbs', | ||
watch: [ | ||
'core/index.js', | ||
paths.server + '**/*.js', | ||
paths.server + '**/*.json', | ||
paths.server + '**/*.hbs', | ||
'core/built/assets/*.js' | ||
], | ||
ignore: [ | ||
'core/client/*', | ||
'core/server/test/*' | ||
] | ||
}).on('restart', function () { | ||
console.info(chalk.cyan('Restarting Ghost due to changes...')); | ||
gulp.src('index.js') | ||
.pipe(livereload()); | ||
}); | ||
}; | ||
|
||
// Starting the 馃殫 to run the server only | ||
// No client watch here. | ||
gulp.task('server', function () { | ||
nodemonServerInit(); | ||
}); | ||
|
||
// Run `gulp dev` to enter development mode | ||
// Filechanges in client will force a livereload | ||
gulp.task('dev', ['server'], shell.task(['ember build --watch'], { | ||
cwd: paths.client, | ||
env: { | ||
FORCE_COLOR: true // this is a fun little tidbit that will pass the colors from Ember to the main process | ||
} | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters