Equation.js/Gruntfile.js

61 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-04-20 09:28:11 +00:00
module.exports = function(grunt) {
grunt.initConfig({
eslint: {
2015-04-20 09:29:59 +00:00
target: ['lib/*.js', 'tests/*.js']
2015-04-20 09:28:11 +00:00
},
babel: {
dist: {
files: [{
expand: true,
2015-04-20 09:55:41 +00:00
src: ['tests/*.js'],
dest: 'dist/'
}, {
expand: true,
src: ['lib/*.js'],
flatten: true,
2015-04-20 09:28:11 +00:00
dest: 'dist/'
}]
}
},
mochaTest: {
files: ['dist/tests/*.js']
},
2015-04-20 10:45:56 +00:00
browserify: {
dist: {
files: {
'equation.js': 'dist/index.js'
},
options: {
browserifyOptions: {
standalone: 'Equation'
}
}
}
},
uglify: {
dist: {
files: {
'equation.min.js': 'equation.js'
}
}
},
2015-04-20 09:28:11 +00:00
watch: {
scripts: {
2015-04-20 09:29:59 +00:00
files: 'lib/*.js',
tasks: ['babel']
2015-04-20 09:28:11 +00:00
}
}
});
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-mocha-test');
2015-04-20 10:45:56 +00:00
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-uglify');
2015-04-20 09:28:11 +00:00
2015-04-20 10:45:56 +00:00
grunt.registerTask('default', ['babel']);
grunt.registerTask('build', ['babel', 'browserify', 'uglify']);
2015-04-20 09:28:11 +00:00
grunt.registerTask('test', ['babel', 'mochaTest']);
};