1
0
Fork 0
mirror of https://github.com/NaN-tic/sao-old.git synced 2023-12-14 02:12:52 +01:00

Allow production build without development dependencies

By default, sao package should be installed with the production option and the
npm task loaded only on demand to reduce.

issue6176
review33741002
This commit is contained in:
C?dric Krier 2017-01-13 20:11:17 +01:00
parent c031fad198
commit 2d8f3962f5
3 changed files with 37 additions and 26 deletions

View file

@ -127,23 +127,34 @@ module.exports = function(grunt) {
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-xgettext');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-po2json');
grunt.loadNpmTasks('grunt-contrib-qunit');
// Default task(s).
grunt.registerTask('default', [
'concat', 'jshint', 'uglify', 'less', 'po2json'
]);
grunt.registerTask('dev', ['concat', 'jshint', 'less:dev']);
grunt.registerTask('msgmerge', ['shell:msgmerge']);
grunt.registerTask('test', ['concat', 'jshint', 'less:dev', 'qunit']);
grunt.registerTask('default', 'Build for production.', function() {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-po2json');
grunt.task.run(['concat', 'jshint', 'uglify', 'less', 'po2json']);
});
grunt.registerTask('dev', 'Build for development.', function() {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.task.run(['concat', 'jshint', 'less:dev']);
});
grunt.registerTask('devwatch', 'Watch development', function() {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.task.run(['watch']);
});
grunt.registerTask('msgmerge', 'Update locale messages.', function() {
grunt.loadNpmTasks('grunt-shell');
grunt.task.run(['shell:msgmerge']);
});
grunt.registerTask('test', 'Run tests', function() {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.task.run(['concat', 'jshint', 'less:dev', 'qunit']);
});
};

2
README
View file

@ -12,7 +12,7 @@ Installation
Once you've downloaded and unpacked the sao source release, enter the directory
where the archive was unpacked, and run:
# npm install
# npm install --production
# grunt
Note that the entry `root` in the section `[web]` of `trytond.conf` must be set

View file

@ -36,16 +36,9 @@
"postinstall": "./node_modules/.bin/bower install --allow-root"
},
"devDependencies": {
"grunt": "^0.4",
"grunt-cli": "^0.1",
"grunt-contrib-concat": "^0.5",
"grunt-contrib-jshint": "^0.11",
"grunt-contrib-less": "^1.2",
"grunt-contrib-nodeunit": "^0.4",
"grunt-contrib-qunit": "^1.2",
"grunt-contrib-uglify": "^0.9",
"grunt-contrib-watch": "^0.6",
"grunt-po2json": "^0.3",
"grunt-shell": "^1.2",
"grunt-xgettext": "^0.3"
},
@ -53,6 +46,13 @@
"tryton"
],
"dependencies": {
"grunt": "^0.4",
"grunt-cli": "^0.1",
"grunt-contrib-concat": "^0.5",
"grunt-contrib-jshint": "^0.11",
"grunt-contrib-uglify": "^0.9",
"grunt-contrib-less": "^1.2",
"grunt-po2json": "^0.3",
"bower": "^1.7"
}
}