knex/gruntfile.js

38 lines
1.0 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: {
files: {
'build/knex.js': ['lib/browser.js'],
},
options: {
alias: ['./lib/migrate-stub.js:./lib/migrate'],
external: ['bluebird/js/main/promise', 'lodash'],
ignoreGlobals: true,
detectGlobals: false,
standalone: 'knex',
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
};