Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Browsersync doesn't detect new HTML #84

Open
IdanCo opened this issue Jan 17, 2017 · 2 comments
Open

Browsersync doesn't detect new HTML #84

IdanCo opened this issue Jan 17, 2017 · 2 comments

Comments

@IdanCo
Copy link

IdanCo commented Jan 17, 2017

I've created a new project and add a new component using the generator -

yo fountain-angular1:component --name myComponent --dir components/game

I've added references to the new component and successfully used it in the code:

import angular from 'angular';

import {hello} from './app/hello';
import 'angular-ui-router';
import routesConfig from './routes';

// here is the new component
import {myComponent} from './app/components/game/myComponent';

import './index.scss';

export const app = 'app';

angular
  .module(app, ['ui.router'])
  .config(routesConfig)
  .component('myComponent', myComponent) // <---- here as well
  .component('app', hello);

changing the js file of the new componenet triggers a browsersync reload.
BUT - changing the html file of the new component doesn't trigger a reload.

Any idea why?

{
  "generator-fountain-angular1": {
    "version": "1.0.0-rc2",
    "props": {
      "css": "scss",
      "resolved": "/Users/idancohen/.nvm/versions/node/v4.2.4/lib/node_modules/generator-fountain-webapp/node_modules/generator-fountain-angular1/generators/app/index.js",
      "framework": "angular1",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "js": "babel",
      "modules": "webpack",
      "ci": [],
      "namespace": "fountain-angular1",
      "sample": "techs",
      "router": "uirouter"
    }
  }
}

Relevant Links

nothing special about it but i've uploaded the repo - https://github.com/IdanCo/test-browsersync

Environment

Node.js v4.2.4
darwin 16.3.0
yo 1.8.5
npm 4.1.1
@IdanCo
Copy link
Author

IdanCo commented Jan 17, 2017

i traced the issue to this line

changing from this -
gulp.watch(conf.path.tmp('index.html'), reloadBrowserSync);

to this -
gulp.watch(conf.path.src('app/**/*.html'), reloadBrowserSync);

solves the issue, but since it's a whole conditional segment I feel I'm missing something... am i wrong? worth a PR?

@IdanCo
Copy link
Author

IdanCo commented Jan 26, 2017

Breakthrough!

I found out the if i change the export part of the component from this

templateUrl: 'full/path/to/component.html
to this
template: require('./component.html')

Then Browsersync listens to changes. Any idea why?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant