knex/gruntfile.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-08-13 17:50:22 -04:00
module.exports = function(grunt) {
2013-12-23 23:06:07 -05:00
grunt.initConfig({
uglify: {
dist: {
files: {
'build/knex-min.js': ['build/knex.js']
}
}
},
browserify: {
dist: {
2013-12-24 08:06:14 -05:00
src: ['knex.js'],
dest: 'build/knex.js',
2013-12-23 23:06:07 -05:00
options: {
alias: ['./lib/migrate-stub.js:./lib/migrate'],
external: ['bluebird/js/main/promise', 'lodash'],
ignoreGlobals: true,
detectGlobals: false,
standalone: 'knex',
2013-12-24 08:06:14 -05:00
preBundleCB: function(b) {
b.require('./clients/websql.js');
2013-12-24 08:06:14 -05:00
},
2013-12-23 23:06:07 -05:00
postBundleCB: function(err, src, next) {
next(err, src
.replace('define(e):"undefined"', 'define(["bluebird", "lodash"], e):"undefined"')
.replace('bluebird/js/main/promise\')()', 'bluebird\')')
.replace('bluebird/js/main/promise', 'bluebird')
);
}
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-browserify');
2013-08-13 17:50:22 -04:00
grunt.loadNpmTasks('grunt-release');
2013-12-23 23:06:07 -05:00
grunt.registerTask('build', ['browserify', 'uglify']);
2013-08-13 17:50:22 -04:00
};