jvandemo / jvandemo/generator-angular2-library

Livereload not working on components in root folder (Angular 5 & Cli 1.7)

Open
#287 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
740
Forks
116
PR merge metrics
No merged PRs in 30d

Description

With latest Angular Cli versions, with a npm linked library (or local library imported by "file:..." in package.json), I received the error:
```
ERROR in ./node_modules/yourlibrary/index.ts
Module build failed: Error: C:\linktest\linkapp\node_modules\yourlibrary\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (C:\linktest\linkapp\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (C:\linktest\linkapp\node_modules\@ngtools\webpack\src\loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

webpack: Failed to compile.
```

solved updating **tsconfig.app.json** with this configuration:

```
"compilerOptions": {
...
"paths": {
"yourlibrary": [
"../node_modules/yourlibrary"
]
}
},
```

After a _ng serve_, updating a component under a folder, app reload library correctly.
Updating a component in src folder of library, server doesn't refresh.

### My environment
Angular CLI: 1.7.3
Node: 8.9.4
OS: win32 x64
Angular: 5.2.9

## RePro
I created an example repo: https://github.com/fabriziodebortoli/linklibrary.git with a new ng app and a new library generated

In linkapp folder, after a `npm i`, can test app with `ng serve` and try to update **sample.component.ts** or **folder/sample2.component.ts**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.