try #2 (I give up, grunt-watch seems so unpredictable... on windows anyways)

v1.18.x
psychobunny 10 years ago
parent 02c310ea03
commit 540facaaab

@ -1,53 +1,56 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
execute: {
express: {
dev: {
src: 'a.js',
options: {
args: ['arg']
script: 'app.js',
node_env: 'development',
args: ['dev', 'from-file'],
output: "NodeBB Ready"
}
},
minifyJS: {
src: 'app.js',
options: {
args: ['from-file']
script: 'app.js',
node_env: 'development',
args: ['dev', 'minify-js'],
output: "NodeBB Ready"
}
},
minifyCSS: {
src: 'app.js',
compileLESS: {
options: {
args: ['from-file']
script: 'app.js',
node_env: 'development',
args: ['dev', 'compile-less'],
output: "NodeBB Ready"
}
},
}
},
watch: {
clientScripts: {
files: ['public/src/**/*.js'],
tasks: ['execute:minifyJS'],
options: {
spawn: false
}
},
serverScripts: {
files: ['*.js', 'src/**/*.js', 'node_modules/**/*.js'],
tasks: ['execute:minifyCSS'],
options: {
spawn: false
less: {
development: {
files: {
"public/bin/manifest.css": "source/manifest.less"
}
},
less: {
files: ['**/*.less'],
tasks: ['execute:minifyCSS'],
}
},
watch: {
compileLESS: {
files: "**/*.less",
tasks: ['express:compileLESS'],
options: {
spawn: false
livereload: true,
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-execute');
grunt.loadNpmTasks('grunt-express-server');
grunt.registerTask('default', ['express:dev', 'watch']);
grunt.registerTask('default', ['watch', 'execute:minifyCSS']);
grunt.event.on('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
};

@ -13,6 +13,7 @@ process.on('message', function(msg) {
}
});
function hashPassword(password, rounds) {
async.waterfall([
function(next) {

@ -71,7 +71,9 @@
"mocha": "~1.13.0",
"grunt": "~0.4.5",
"grunt-contrib-watch": "^0.6.1",
"grunt-execute": "^0.2.2"
"grunt-execute": "^0.2.2",
"grunt-express-server": "^0.4.19",
"grunt-contrib-less": "^1.0.0"
},
"bugs": {
"url": "https://github.com/NodeBB/NodeBB/issues"

@ -3,4 +3,21 @@
display:inline-block;
width:220px;
}
}
}

@ -1,5 +1,6 @@
'use strict';
if ('undefined' !== typeof window) {
(function ($, undefined) {

@ -39,8 +39,8 @@ if(nconf.get('ssl')) {
// Preparation dependent on plugins
plugins.ready(function() {
async.parallel([
async.apply(!nconf.get('from-file') ? meta.js.minify : meta.js.getFromFile, app.enabled('minification')),
async.apply(!nconf.get('from-file') ? meta.css.minify : meta.css.getFromFile),
async.apply((!nconf.get('minify-js') && !nconf.get('from-file')) ? meta.js.minify : meta.js.getFromFile, app.enabled('minification')),
async.apply((!nconf.get('compile-less') && !nconf.get('from-file')) ? meta.css.minify : meta.css.getFromFile),
async.apply(meta.sounds.init)
]);
});

Loading…
Cancel
Save