From 08815d188b7521f4f9ef617d32bb37fce6f9486b Mon Sep 17 00:00:00 2001 From: Adam Bullmer Date: Sun, 2 Apr 2017 22:21:18 -0500 Subject: [PATCH] Prepared fix for livereload compatible changes to index.html --- lib/angular-app.js | 17 +++++++++++++++-- package.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/angular-app.js b/lib/angular-app.js index f13f63d..852ea5a 100644 --- a/lib/angular-app.js +++ b/lib/angular-app.js @@ -170,8 +170,21 @@ AngularApp.prototype.templateTree = function () { }; AngularApp.prototype.htmlTree = function () { - return new Funnel('./index.html', { - destDir: '/index.html', + const fs = require('fs'); + + if (fs.existsSync('./index.html')) { + console.warn(`${chalk.red('⚠ WARNING!')} Default location of ${chalk.cyan("/index.html")} has changed`); + console.warn(`${chalk.red('⚠ WARNING!')} Please migrate to ${chalk.cyan("/app/index.html")} to follow the most recent update`); + + return new Funnel('./index.html', { + destDir: '/index.html', + annotation: 'Funnel: index.html' + }); + } + + return new Funnel('app', { + include: ['index.html'], + destDir: '/', annotation: 'Funnel: index.html' }); }; diff --git a/package.json b/package.json index 6b61588..683bc29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-bro-app", - "version": "0.10.0", + "version": "0.10.1", "description": "Angular broccoli plugin and compilation routine", "main": "lib/angular-app.js", "scripts": {