Skip to content

ng serve - npm linked library changes(updates) are not reflected in UI #6195

Closed
@tirnovanuaurel

Description

@tirnovanuaurel

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.1
node: 6.10.1
os: darwin x64
@angular/common: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.1
@angular/compiler: 4.1.1
@angular/compiler-cli: 4.1.1

macOs Sierra 10.12.4
Node: v6.10.1
Npm: 3.10.10

Repro steps.

  • Generate 'myProject' with angular-cli
  • Add a private npm package: npm install @private/etcPackage --save (it's a angular4 library)
  • Go to the private package local path and 'npm link'
  • Go to 'myProject' and run: npm link @private/etcPackage
  • Delete 'node_modules' from 'myProject/node_modules/@private/etcPackage'
  • start serve: ng serve --aot
  • on library project, '/localpath/etcPackage' run gulp (this will trigger watch and build on change)

Since this dist folder it's linked with node_modules one in my angular project 'myProject' for every build the package is update.

The log given by the failure.

Doesn't update UI on changes.

Desired functionality.

When the library (etc - in our case) it's compiled along with it's resources, the angular-cli project should see the changes and update the UI. Eg: external html templates and css - not updated.

Mention any other details that might be useful.

  • I'm using templateUrl: 'etc.html' and not have any template inline;
  • If any change is made to componentName.ts file - this is reflected on screen (eg: variables);
  • Changes exist after library it gets build in 'myProject/node_modules/@private/etcPackage' folder, so link it's working;
  • Even if i refresh page, and I check main.bundle.js - changes are there compiled, but still are not visible on screen unless I stop serve and start it again.

--

Question is, anything can be done or need create a separate watch script to support both the library and myProject?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulhelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions