| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- module.exports = function (grunt) {
- grunt.initConfig({
- jshint: {
- options: {
- reporter: require('jshint-stylish'),
- jshintrc: true
- },
- build: {
- src: ['gruntfile.js', 'tasks/*.js']
- },
- src: {
- src: 'src/**/*.js'
- },
- test: {
- src: 'test/**/*.js'
- }
- },
- karma: {
- options: {
- frameworks: ['jasmine', 'commonjs'],
- files: [
- 'src/**/*.js',
- 'test/unit/**/*.js'
- ],
- preprocessors: {
- 'src/**/*.js': ['commonjs'],
- 'test/unit/**/*.js': ['commonjs']
- },
- singleRun: true
- },
- browsers: {
- options: {
- browsers: ['Chrome', 'Firefox'],
- reporters: ['progress']
- }
- },
- phantom: {
- options: {
- browsers: ['PhantomJS'],
- reporters: ['progress']
- }
- }
- },
- browserify: {
- build: {
- src: ['src/vue.js'],
- dest: 'dist/vue.js',
- options: {
- bundleOptions: {
- standalone: 'Vue'
- }
- }
- },
- watch: {
- src: ['src/vue.js'],
- dest: 'dist/vue.js',
- options: {
- watch: true,
- keepAlive: true,
- bundleOptions: {
- standalone: 'Vue'
- }
- }
- },
- bench: {
- src: ['benchmarks/*.js', '!benchmarks/browser.js'],
- dest: 'benchmarks/browser.js'
- }
- }
- })
-
- // load npm tasks
- grunt.loadNpmTasks('grunt-contrib-jshint')
- grunt.loadNpmTasks('grunt-karma')
- grunt.loadNpmTasks('grunt-browserify')
- // load custom tasks
- grunt.file.recurse('tasks', function (path) {
- require('./' + path)(grunt)
- })
- grunt.registerTask('unit', ['karma:browsers'])
- grunt.registerTask('phantom', ['karma:phantom'])
- grunt.registerTask('watch', ['browserify:watch'])
- grunt.registerTask('build', ['browserify:build'])
- }
|