question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Opt out of ngcc in postinstall-script

See original GitHub issue

Current Behavior

Angulars lib and app-generator are appending ngcc on postinstall-script in package.json. Our organization does not need this post-compilation script, since all our dependencies are Ivy-compatible.

Expected Behavior

Discard behavior or add ability to opt out via configuration

Steps to Reproduce

  1. Call one of these generators. (We are using them as part of our workspace-generators) import { applicationGenerator } from '@nrwl/angular/generators'; import { libraryGenerator } from '@nrwl/angular/generators';

  2. Observe that ngcc is appended to postinstall-script in package.json

Failure Logs

Environment

   OS   : darwin x64
   yarn : 1.22.18

   nx : 13.10.2
   @nrwl/angular : 13.8.3
   @nrwl/cli : 13.8.3
   @nrwl/cypress : 13.8.3
   @nrwl/detox : undefined
   @nrwl/devkit : 13.10.2
   @nrwl/eslint-plugin-nx : 13.8.3
   @nrwl/express : undefined
   @nrwl/jest : 13.8.3
   @nrwl/js : undefined
   @nrwl/linter : 13.8.3
   @nrwl/nest : undefined
   @nrwl/next : undefined
   @nrwl/node : 13.8.3
   @nrwl/nx-cloud : 13.1.5
   @nrwl/react : undefined
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.3
   @nrwl/tao : 13.8.3
   @nrwl/web : undefined
   @nrwl/workspace : 13.8.3
   typescript : 4.5.5
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
   	 @angular/animations: 13.2.4
   	 @angular/cdk: 13.3.2
   	 @angular/common: 13.2.4
   	 @angular/compiler: 13.2.4
   	 @angular/core: 13.2.4
   	 @angular/forms: 13.2.4
   	 @angular/localize: 13.2.4
   	 @angular/material: 13.3.2
   	 @angular/platform-browser: 13.2.4
   	 @angular/platform-browser-dynamic: 13.2.4
   	 @angular/router: 13.2.4
   	 @ngrx/component: 13.1.0
   	 @ngrx/effects: 13.0.2
   	 @ngrx/entity: 13.0.2
   	 @ngrx/router-store: 13.0.2
   	 @ngrx/store: 13.0.2
   	 @ngrx/store-devtools: 13.0.2
   	 @angular-devkit/build-angular: 13.2.5
   	 @angular/cli: 13.2.5
   	 @angular/compiler-cli: 13.2.4
   	 @angular/language-service: 13.2.4
   	 @ngrx/schematics: 13.0.2
   	 @scullyio/init: 2.1.29
   	 @storybook/angular: 6.4.22
   	 eslint-plugin-ngrx: 2.1.2
   	 ng-mocks: 13.4.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
stianmorsundcommented, May 6, 2022

I made a PR for the missing skipPackageJson-typing (https://github.com/nrwl/nx/pull/10179). I’ll look into skipping postinstall later 😃

1reaction
leosvelperezcommented, May 5, 2022

@stianmorsund it’s not intended; it’s a typing issue. The actual schema (schema.json) does have that property, but it’s not reflected in the types for the generator options.

If you’re up for adding the --skip-postinstall flag, you can also add the missing skipPackageJson to the schema.d.ts file in that same PR. Otherwise, let me know and I’ll address this soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 10: postinstall script needed? - Stack Overflow
If you opt-out of bundling dependencies you will need to run the standalone Angular compatibility compiler (ngcc). This is needed because ...
Read more >
Angular 9: ngcc in postinstall script... : r/Angular2 - Reddit
I just finished upgrading from Angular 8 to Angular 9. The upgrade guide recommended the following step: If you depend on many Angular ......
Read more >
Getting Started with Monorepo with Nx Nrwl - Rupesh Tiwari
Using Nx CLI over Angular CLI; How to opt out of NX CLI ... Remove the script from your postinstall script in your...
Read more >
Angular Ivy Compiler - LinkedIn
CLI instructions run ngcc as wished whilst acting an Angular build. Maintaining library compatibility ... Opting out of Ivy in version 9.
Read more >
Angular Ivy
CLI commands run ngcc as needed when performing an Angular build. ... To opt out of Ivy, change the angularCompilerOptions in your project's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found