diff --git a/Gruntfile.js b/Gruntfile.js index 8fb75a3ed..1d0a0c639 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,6 +29,24 @@ module.exports = function(grunt) { dest: 'build/<%= pkg.name %>-<%= pkg.version %>.js' } }, + + replace: { + dist: { + options: { + patterns: [ + { + match: 'VERSION', + replacement: '<%= pkg.version %>', + expression: false // simple variable lookup + } + ] + }, + files: [ + {expand: true, flatten: true, src: ['build/index.html'], dest: 'build/'} + ] + } + }, + /** * Rules of how to minify & obfuscate game sources */ @@ -65,6 +83,9 @@ module.exports = function(grunt) { clean: { dist: [ 'build/*' + ], + concat: [ + '<%= concat.dist.dest %>' ] }, /** @@ -89,9 +110,9 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); - // grunt.loadNpmTasks('grunt-replace'); + grunt.loadNpmTasks('grunt-replace'); // Default task. - grunt.registerTask('default', ['concat', 'uglify', 'copy']); + grunt.registerTask('default', ['concat', 'uglify', 'copy', 'replace', 'clean:concat']); grunt.registerTask('lint', ['jshint:beforeConcat']); }; \ No newline at end of file diff --git a/index-dev.html b/index-dev.html new file mode 100644 index 000000000..4a647de6a --- /dev/null +++ b/index-dev.html @@ -0,0 +1,79 @@ + + + + + + + + + Psiral - Javascript/HTML5 game (Game-Off 2013) + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index 4a647de6a..09b5ac26a 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ diff --git a/package.json b/package.json index 8f5ff4754..b1e7bc50e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "grunt-contrib-uglify": "~0.3.2", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-copy": "~0.5.0" + "grunt-contrib-copy": "~0.5.0", + "grunt-replace": "~0.6.1" }, "engines": { "node": ">=0.8"