Skip to content

Node.js based forum software built for the modern web

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

psychobunny540facaaab27
diff --git a/Gruntfile.js b/Gruntfile.js
index 19b0af68d0..4db400bf83 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -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);
+ });
};
\ No newline at end of file
diff --git a/bcrypt.js b/bcrypt.js
index 7611ab61a9..1445999a8a 100644
--- a/bcrypt.js
+++ b/bcrypt.js
@@ -13,6 +13,7 @@ process.on('message', function(msg) {
}
});
+
function hashPassword(password, rounds) {
async.waterfall([
function(next) {
diff --git a/package.json b/package.json
index 6d3525778c..cf4289efbf 100644
--- a/package.json
+++ b/package.json
@@ -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"
diff --git a/public/less/admin/advanced/database.less b/public/less/admin/advanced/database.less
index c81ef613cc..3799ced20a 100644
--- a/public/less/admin/advanced/database.less
+++ b/public/less/admin/advanced/database.less
@@ -3,4 +3,21 @@
display:inline-block;
width:220px;
}
-}
\ No newline at end of file
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/src/overrides.js b/public/src/overrides.js
index 978dea0720..913a5abf3f 100644
--- a/public/src/overrides.js
+++ b/public/src/overrides.js
@@ -1,5 +1,6 @@
'use strict';
+
if ('undefined' !== typeof window) {
(function ($, undefined) {
diff --git a/src/webserver.js b/src/webserver.js
index 01dee2b91c..5512c84e40 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -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)
]);
});