Skip to content

@ngtools/webpack eagerly reloading everything inside of src folder for ng serve #6238

Closed
@smithad15

Description

@smithad15

Bug Report or Feature Request (mark with an x)

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

@ngtools/webpack is causing webpack-dev-server to eagerly rebuild for any change inside of the folder that contains the tsconfig file. This includes files that are not referenced by webpack at all. This can be a huge problem for development if your tsconfig.json file is in the root of your application folder as even git changes trigger a rebuild.

Versions.

@angular/cli: 1.0.2
node: 7.2.1
os: darwin x64
@angular/common: 4.1.1
@angular/compiler: 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.2
@angular/compiler-cli: 4.1.1

Repro steps.

Inside of Angular CLI
From a newly created project, start up the dev server and add an empty file in src without a file extension. The dev server will rebuild.

Inside of a custom project
If you are using @ngtools/webpack for your development build inside of a project with a custom webpack configuration (ejected projects also count), and your tsConfigPath references a tsconfig.json file in the root of the project, start up the dev server and stage a file in git. You will see the dev server rebuild.

The log given by the failure.

N/A

Desired functionality.

@ngtools/webpack should not be increasing the scope of watched files in the project beyond the boundaries of what has been configured inside of webpack itself. If the file is not in the bundle, it should not trigger a rebuild from webpack-dev-server.

Mention any other details that might be useful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions