Skip to content

Questions on affected npm scripts #212

@dereklin

Description

@dereklin

I am following this blog and trying out the affected npm scripts:
https://blog.nrwl.io/smarter-faster-builds-with-nrwl-nx-c2fd0d1a3277

I have some questions:

  1. It seems like affected:apps and apps:affected are the same. This is true for build and e2e. Why provide two names of the same thing?

  2. for affected:build. It runs this internally:

child_process_1.execSync("ng build " + rest.join(' ') + " -a=" + app, { stdio: [0, 1, 2] });

How can I run a totally different script? Let's say I have a script:

"build:app1:prerender": "npm run build:app1:client-and-server-bundles && npm run webpack:app1:server && npm run generate:app1:prerender",

I want to run build:app1:prerender to build my app1 instead of the standard build. How can I do that?

Same question for affected:e2e. If I have different protractor setup's and I don't want to run the standard ng e2e, but instead I want to run protractor directly. How can I do that?

  1. I gave affected:apps a try. On a repo with apps set up like this: https://github.com/dereklin/nx-demo-jest/blob/lazy-5/.angular-cli.json
    I made a html change inside apps/app1/src
    It reports that the affected app is app1-ngu-app-shell only
    I expected it to show both app1 and app1-ngu-app-shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions