mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Move run:dev task to gulp
This commit is contained in:
27
Gruntfile.js
27
Gruntfile.js
@@ -159,29 +159,6 @@ module.exports = function(grunt) {
|
|||||||
],
|
],
|
||||||
dest: 'website/build/*.css'
|
dest: 'website/build/*.css'
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
nodemon: {
|
|
||||||
dev: {
|
|
||||||
script: '<%= pkg.main %>'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
dev: {
|
|
||||||
files: ['website/public/**/*.styl', 'common/script/**/*.coffee', 'common/script/**/*.js'], // 'public/**/*.js' Not needed because not in production
|
|
||||||
tasks: [ 'build:dev' ],
|
|
||||||
options: {
|
|
||||||
nospawn: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
concurrent: {
|
|
||||||
dev: ['nodemon', 'watch'],
|
|
||||||
options: {
|
|
||||||
logConcurrentOutput: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -228,8 +205,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('build:dev', ['browserify', 'stylus']);
|
grunt.registerTask('build:dev', ['browserify', 'stylus']);
|
||||||
grunt.registerTask('build:test', ['test:prepare:translations', 'build:dev']);
|
grunt.registerTask('build:test', ['test:prepare:translations', 'build:dev']);
|
||||||
|
|
||||||
grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]);
|
|
||||||
|
|
||||||
grunt.registerTask('test:prepare:translations', function() {
|
grunt.registerTask('test:prepare:translations', function() {
|
||||||
require('coffee-script');
|
require('coffee-script');
|
||||||
var i18n = require('./website/src/i18n'),
|
var i18n = require('./website/src/i18n'),
|
||||||
@@ -246,8 +221,6 @@ module.exports = function(grunt) {
|
|||||||
grunt.loadNpmTasks('grunt-contrib-stylus');
|
grunt.loadNpmTasks('grunt-contrib-stylus');
|
||||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
grunt.loadNpmTasks('grunt-nodemon');
|
|
||||||
grunt.loadNpmTasks('grunt-concurrent');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
grunt.loadNpmTasks('grunt-spritesmith');
|
grunt.loadNpmTasks('grunt-spritesmith');
|
||||||
grunt.loadNpmTasks('grunt-contrib-imagemin');
|
grunt.loadNpmTasks('grunt-contrib-imagemin');
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-browserify": "^3.3.0",
|
"grunt-browserify": "^3.3.0",
|
||||||
"grunt-cli": "~0.1.9",
|
"grunt-cli": "~0.1.9",
|
||||||
"grunt-concurrent": "~1.0.0",
|
|
||||||
"grunt-contrib-clean": "~0.6.0",
|
"grunt-contrib-clean": "~0.6.0",
|
||||||
"grunt-contrib-copy": "~0.6.0",
|
"grunt-contrib-copy": "~0.6.0",
|
||||||
"grunt-contrib-cssmin": "~0.10.0",
|
"grunt-contrib-cssmin": "~0.10.0",
|
||||||
@@ -32,7 +31,6 @@
|
|||||||
"grunt-contrib-watch": "~0.6.1",
|
"grunt-contrib-watch": "~0.6.1",
|
||||||
"grunt-hashres": "~0.4.1",
|
"grunt-hashres": "~0.4.1",
|
||||||
"grunt-karma": "~0.6.2",
|
"grunt-karma": "~0.6.2",
|
||||||
"grunt-nodemon": "~0.3.0",
|
|
||||||
"grunt-spritesmith": "~3.5.0",
|
"grunt-spritesmith": "~3.5.0",
|
||||||
"gulp": "^3.9.0",
|
"gulp": "^3.9.0",
|
||||||
"gulp-grunt": "^0.5.2",
|
"gulp-grunt": "^0.5.2",
|
||||||
@@ -83,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "./node_modules/.bin/gulp test",
|
"test": "./node_modules/.bin/gulp test",
|
||||||
"start": "grunt run:dev",
|
"start": "gulp run:dev",
|
||||||
"postinstall": "./node_modules/bower/bin/bower --config.interactive=false install -f; ./node_modules/.bin/gulp build;",
|
"postinstall": "./node_modules/bower/bin/bower --config.interactive=false install -f; ./node_modules/.bin/gulp build;",
|
||||||
"coverage": "COVERAGE=true mocha --require register-handlers.js --reporter html-cov > coverage.html; open coverage.html"
|
"coverage": "COVERAGE=true mocha --require register-handlers.js --reporter html-cov > coverage.html; open coverage.html"
|
||||||
},
|
},
|
||||||
@@ -97,6 +95,7 @@
|
|||||||
"expect.js": "~0.2.0",
|
"expect.js": "~0.2.0",
|
||||||
"glob": "^4.3.5",
|
"glob": "^4.3.5",
|
||||||
"grunt-contrib-imagemin": "^0.9.4",
|
"grunt-contrib-imagemin": "^0.9.4",
|
||||||
|
"gulp-nodemon": "^2.0.4",
|
||||||
"istanbul": "^0.3.14",
|
"istanbul": "^0.3.14",
|
||||||
"karma": "~0.10.2",
|
"karma": "~0.10.2",
|
||||||
"karma-chai-plugins": "~0.1.0",
|
"karma-chai-plugins": "~0.1.0",
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ gulp.task('build:dev', ['prepare:staticNewStuff'], (done) => {
|
|||||||
gulp.start('grunt-build:dev', done);
|
gulp.start('grunt-build:dev', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('build:dev:watch', ['build:dev'], () => {
|
||||||
|
gulp.watch(['website/public/**/*.styl', 'common/script/*']);
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('build:prod', ['prepare:staticNewStuff'], (done) => {
|
gulp.task('build:prod', ['prepare:staticNewStuff'], (done) => {
|
||||||
gulp.start('grunt-build:prod', done);
|
gulp.start('grunt-build:prod', done);
|
||||||
});
|
});
|
||||||
|
|||||||
14
tasks/gulp-start.js
Normal file
14
tasks/gulp-start.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import gulp from 'gulp';
|
||||||
|
import nodemon from 'gulp-nodemon';
|
||||||
|
|
||||||
|
let pkg = require('../package.json');
|
||||||
|
require('gulp-grunt')(gulp);
|
||||||
|
|
||||||
|
gulp.task('run:dev', ['nodemon', 'build:dev:watch']);
|
||||||
|
|
||||||
|
gulp.task('nodemon', () => {
|
||||||
|
nodemon({
|
||||||
|
script: pkg.main,
|
||||||
|
ignore: ['website/public/*', 'website/views/*']
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user