mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
try #2 (I give up, grunt-watch seems so unpredictable... on windows anyways)
This commit is contained in:
59
Gruntfile.js
59
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: {
|
||||
files: ['**/*.less'],
|
||||
tasks: ['execute:minifyCSS'],
|
||||
development: {
|
||||
files: {
|
||||
"public/bin/manifest.css": "source/manifest.less"
|
||||
}
|
||||
}
|
||||
},
|
||||
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', ['watch', 'execute:minifyCSS']);
|
||||
grunt.registerTask('default', ['express:dev', 'watch']);
|
||||
|
||||
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"
|
||||
|
||||
@@ -4,3 +4,20 @@
|
||||
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)
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user