diff --git a/packages/angular/cli/src/utilities/package-metadata.ts b/packages/angular/cli/src/utilities/package-metadata.ts index faded207495f..0d683fedecc5 100644 --- a/packages/angular/cli/src/utilities/package-metadata.ts +++ b/packages/angular/cli/src/utilities/package-metadata.ts @@ -212,6 +212,10 @@ function normalizeOptions( } catch {} } break; + case 'before': + options['before'] = + typeof substitutedValue === 'string' ? new Date(substitutedValue) : substitutedValue; + break; default: options[key] = substitutedValue; break; diff --git a/tests/legacy-cli/e2e/tests/commands/add/npm-config.ts b/tests/legacy-cli/e2e/tests/commands/add/npm-config.ts new file mode 100644 index 000000000000..6f7599e8c00c --- /dev/null +++ b/tests/legacy-cli/e2e/tests/commands/add/npm-config.ts @@ -0,0 +1,8 @@ +import { writeFile } from '../../../utils/fs'; +import { ng } from '../../../utils/process'; + +export default async function () { + // Works with before option + await writeFile('.npmrc', `before=${new Date().toISOString()}`); + await ng('add', '@angular/pwa', '--skip-confirmation'); +}