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:
parent
c031fad198
commit
2d8f3962f5
47
Gruntfile.js
47
Gruntfile.js
|
@ -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
2
README
|
@ -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
|
||||
|
|
14
package.json
14
package.json
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue