Game Development Reference
In-Depth Information
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 8080,
base: './'
}
}
},
open: {
dev: {
path: 'http://localhost:8080/index.html'
}
}
});
grunt.registerTask('default', ['connect', 'open']);
}
So, with this file you should be able to CD into your directory where the GruntFile.js is and
run it. Let's go through how the file works before we run it.
To start off, we need to import the modules we need, so you will see the following:
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
Here we are simply importing the Grunt tasks for connect and open. After this we need to
configure each command. Our first one sets up the server.
connect: {
server: {
options: {
port: 8080,
base: './'
}
Search WWH ::




Custom Search