Last active
September 24, 2020 15:44
-
-
Save martinVelicky/ad53cbba30ffb92599461aa891844c3f to your computer and use it in GitHub Desktop.
Grunt.js local development template
This file contains hidden or 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 = function(grunt) { | |
grunt.initConfig({ | |
connect : { | |
default : { | |
options : { | |
port : 4478, | |
livereload : 35728, | |
hostname : '*' | |
} | |
} | |
}, | |
watch : { | |
scripts : { | |
files : ['**/*.css', '**/*.html', '**/*.js', '**/*.json'] | |
}, | |
options : { | |
livereload : 35728, | |
spawn : false | |
} | |
} | |
}); | |
grunt.loadNpmTasks("grunt-contrib-watch"); | |
grunt.loadNpmTasks("grunt-contrib-connect"); | |
// Default task(s). | |
grunt.registerTask('default', ['connect', 'watch']); | |
}; |
This file contains hidden or 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
{ | |
"name": "Grunt.js setup for local web development", | |
"version": "0.0.1", | |
"description": "Copy your HTML, JS and CSS files anywhere in the folder and have it reloaded on localhost:4478", | |
"main": "index.html", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Martin Velicky", | |
"license": "BSD-2-Clause", | |
"devDependencies": { | |
"grunt": "^1.0.1", | |
"grunt-contrib-connect": "^1.0.2", | |
"grunt-contrib-watch": "^1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm install
and thengrunt