Created
December 25, 2015 10:42
-
-
Save husa/c57fe4e3c08b49c79f10 to your computer and use it in GitHub Desktop.
FAST grunt + livereload + browserify + babelify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = grunt => { | |
const LIVERELOAD_PORT = 35729; | |
require('load-grunt-tasks')(grunt, {}); | |
require('time-grunt')(grunt); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
browserify: { | |
watch: { | |
files: { | |
'build/bundle.js': ['src/js/*.js'] | |
}, | |
options: { | |
watch: true, | |
transform: [ | |
[ | |
'babelify', | |
{ | |
presets: [ | |
'es2015' | |
] | |
} | |
] | |
] | |
} | |
} | |
}, | |
eslint: { | |
target: ['src/js/*.js'], | |
options: { | |
configFile: '.eslintrc', | |
cache: true | |
} | |
}, | |
connect: { | |
server: { | |
options: { | |
port: 9090, | |
base: '.', | |
open: true, | |
livereload: LIVERELOAD_PORT, | |
hostname: 'localhost' | |
// keepalive: true | |
} | |
} | |
}, | |
watch: { | |
livereload: { | |
files: ['build/**/*'], | |
options: { | |
livereload: LIVERELOAD_PORT | |
} | |
} | |
} | |
}); | |
grunt.registerTask('default', [ | |
// 'eslint', | |
'browserify:watch', | |
'connect:server', | |
'watch' | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment