bench.js 505 B

12345678910111213141516171819202122232425
  1. /**
  2. * Run benchmarks in Node
  3. */
  4. module.exports = function (grunt) {
  5. grunt.registerTask('bench', function () {
  6. // polyfill window/document for old Vue
  7. global.window = {
  8. setTimeout: setTimeout,
  9. console: console
  10. }
  11. global.document = {
  12. documentElement: {}
  13. }
  14. require('fs')
  15. .readdirSync('./benchmarks')
  16. .forEach(function (mod) {
  17. if (mod === 'browser.js' || mod === 'runner.html') return
  18. require('../benchmarks/' + mod)
  19. })
  20. })
  21. }