vue2/gruntfile.js

92 lines
1.9 KiB
JavaScript
Raw Normal View History

2014-07-09 01:45:53 +08:00
module.exports = function (grunt) {
2014-07-09 06:14:04 +08:00
grunt.initConfig({
jshint: {
options: {
reporter: require('jshint-stylish'),
jshintrc: true
},
build: {
src: ['gruntfile.js', 'tasks/*.js']
},
src: {
src: 'src/**/*.js'
},
test: {
2014-07-26 23:29:56 +08:00
src: 'test/**/*.js'
2014-07-09 06:14:04 +08:00
}
},
karma: {
options: {
frameworks: ['jasmine', 'commonjs'],
files: [
'src/**/*.js',
2014-07-10 07:08:01 +08:00
'test/unit/**/*.js'
2014-07-09 06:14:04 +08:00
],
preprocessors: {
'src/**/*.js': ['commonjs'],
2014-07-10 07:08:01 +08:00
'test/unit/**/*.js': ['commonjs']
2014-07-09 06:14:04 +08:00
},
singleRun: true
},
browsers: {
options: {
2014-07-10 07:08:01 +08:00
browsers: ['Chrome', 'Firefox'],
reporters: ['progress']
}
},
phantom: {
options: {
browsers: ['PhantomJS'],
reporters: ['progress']
2014-07-09 06:14:04 +08:00
}
}
},
browserify: {
build: {
src: ['src/vue.js'],
2014-07-12 02:00:53 +08:00
dest: 'dist/vue.js',
options: {
bundleOptions: {
standalone: 'Vue'
}
}
2014-07-09 06:14:04 +08:00
},
watch: {
src: ['src/vue.js'],
dest: 'dist/vue.js',
options: {
watch: true,
2014-07-12 02:00:53 +08:00
keepAlive: true,
bundleOptions: {
standalone: 'Vue'
}
2014-07-09 01:45:53 +08:00
}
2014-07-12 02:00:53 +08:00
},
bench: {
src: ['benchmarks/*.js', '!benchmarks/browser.js'],
dest: 'benchmarks/browser.js'
2014-07-09 06:14:04 +08:00
}
}
})
2014-07-09 06:35:39 +08:00
// load npm tasks
2014-07-09 06:14:04 +08:00
grunt.loadNpmTasks('grunt-contrib-jshint')
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-browserify')
2014-07-09 01:45:53 +08:00
2014-07-09 06:35:39 +08:00
// load custom tasks
grunt.file.recurse('tasks', function (path) {
require('./' + path)(grunt)
})
2014-07-09 06:14:04 +08:00
grunt.registerTask('unit', ['karma:browsers'])
2014-07-10 07:08:01 +08:00
grunt.registerTask('phantom', ['karma:phantom'])
2014-07-09 06:14:04 +08:00
grunt.registerTask('watch', ['browserify:watch'])
grunt.registerTask('build', ['browserify:build'])
2014-07-09 01:45:53 +08:00
}