From 574966b89d1b638f84eaaf29e72af687e0837da6 Mon Sep 17 00:00:00 2001 From: Daniel Jackson Date: Sun, 6 Jan 2019 20:42:07 +0000 Subject: [PATCH] Fixes #5 --- bin/install.js | 18 ++++++++++++++++++ gruntfile.js | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/bin/install.js b/bin/install.js index e1fd376..86587a5 100644 --- a/bin/install.js +++ b/bin/install.js @@ -68,6 +68,24 @@ function promptForPhaserBuild() { } }); + filename = 'gruntfile.js'; + + fs.readFile(filename, 'utf8', function (err, data) { + if (err) { + console.warn(styleText('Failed to open gruntfile.js\nYou will need to update it manually to point to phaser-ce', 'yellow')); + console.warn(err); + } else { + var result = data.replace(/node_modules\/phaser\//, 'node_modules\/phaser-ce\/'); + + fs.writeFile(filename, result, 'utf8', function (err) { + if (err) { + console.warn(styleText('Failed to update gruntfile.js\nYou will need to update it manually to point to phaser-ce', 'yellow')); + console.warn(err); + } + }); + } + }); + setPhaserDep('phaser-ce'); } else { setPhaserDep('phaser'); diff --git a/gruntfile.js b/gruntfile.js index 541c32f..d9b89c6 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -38,7 +38,7 @@ module.exports = function (grunt) { dest: 'public/index.html' }, { - src: 'node_modules/phaser-ce/build/custom/phaser-no-physics.js', + src: 'node_modules/phaser/build/custom/phaser-no-physics.js', dest: 'public/vendor/phaser/phaser.js' } ] @@ -58,7 +58,7 @@ module.exports = function (grunt) { dest: 'public/index.html' }, { - src: 'node_modules/phaser-ce/build/custom/phaser-no-physics.js', + src: 'node_modules/phaser/build/custom/phaser-no-physics.js', dest: 'public/vendor/phaser/phaser.js' } ] @@ -83,7 +83,7 @@ module.exports = function (grunt) { uglify: { prod: { files: { - 'public/game.min.js': ['public/game.min.js'] + 'public/game.min.js': ['public/vendor/phaser/phaser.js', 'public/game.min.js'], } } }