Skip to content

Instantly share code, notes, and snippets.

@husa
Created December 25, 2015 10:42
Show Gist options
  • Save husa/c57fe4e3c08b49c79f10 to your computer and use it in GitHub Desktop.
Save husa/c57fe4e3c08b49c79f10 to your computer and use it in GitHub Desktop.
FAST grunt + livereload + browserify + babelify
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