Skip to content

--watch not working, the issue is in the tasks-watch.js file, please see my proposed fix. #37

@BoHuCB

Description

@BoHuCB

Hello guys,

First, thanks for building this useful tool.

Recently we upgraded to "ngm-cli": "1.0.4" and the --watch doesn't work for us anymore. So I did a little bit of research. Here is what I found.

When use command "ngm build -p src --watch=true --skip-bundles" and save any changes, the application is not automatically built again due to the error below.
image

The issue is caused by this

.then(taskQueue => tasksWatch({project, taskQueue, watch, paths: null}));
. The path passed into tasksWatch is specifically null.

There is another issue with tasks-watch.js file at

task.skip = () => changedModule && i !== changedModule;
.
There are two issues with this code.

  1. The first time the runTasks() runs, changedModule && i !== changedModule is undefined, which means every taks.skip would be undefined.
  2. The file changes, if somehow changedModule is 0. changedModule && i !== changedModule would return the value 0 instead of a boolean value.

I kind of fixed it like screenshot below.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions