From 44a86005dbd4b7852908bd300bf6b14e65eb5e28 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Fri, 2 Nov 2018 00:52:28 +0100 Subject: [PATCH] build: material-moment-adapter should not depend on all material packages (#13931) Since we have the ability to only build specific parts of Material with Bazel, the `material-moment-adapter` should just depend on it's *actual* dependencies and not on the _whole set_ of Material entry-points. --- src/material-moment-adapter/BUILD.bazel | 3 ++- src/material-moment-adapter/adapter/index.ts | 2 +- src/material-moment-adapter/adapter/moment-date-adapter.ts | 2 +- src/material-moment-adapter/adapter/moment-date-formats.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/material-moment-adapter/BUILD.bazel b/src/material-moment-adapter/BUILD.bazel index 7fb2c9f4ec5..5e1829c6ab3 100644 --- a/src/material-moment-adapter/BUILD.bazel +++ b/src/material-moment-adapter/BUILD.bazel @@ -9,8 +9,9 @@ ng_module( srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]), module_name = "@angular/material-moment-adapter", deps = [ + "@angular//packages/core", "@npm//moment", - "//src/lib:material" + "//src/lib/core" ], # Explicitly specify the tsconfig that is also used by Gulp. We need to explicitly use this # tsconfig because in order to import Moment with TypeScript, we need some special options diff --git a/src/material-moment-adapter/adapter/index.ts b/src/material-moment-adapter/adapter/index.ts index 1aa29b2e892..6bbf0a75959 100644 --- a/src/material-moment-adapter/adapter/index.ts +++ b/src/material-moment-adapter/adapter/index.ts @@ -7,7 +7,7 @@ */ import {NgModule} from '@angular/core'; -import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material'; +import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; import {MAT_MOMENT_DATE_ADAPTER_OPTIONS, MomentDateAdapter} from './moment-date-adapter'; import {MAT_MOMENT_DATE_FORMATS} from './moment-date-formats'; diff --git a/src/material-moment-adapter/adapter/moment-date-adapter.ts b/src/material-moment-adapter/adapter/moment-date-adapter.ts index 028a4ca5738..32fc0b2b8f1 100644 --- a/src/material-moment-adapter/adapter/moment-date-adapter.ts +++ b/src/material-moment-adapter/adapter/moment-date-adapter.ts @@ -7,7 +7,7 @@ */ import {Inject, Injectable, Optional, InjectionToken} from '@angular/core'; -import {DateAdapter, MAT_DATE_LOCALE} from '@angular/material'; +import {DateAdapter, MAT_DATE_LOCALE} from '@angular/material/core'; // Depending on whether rollup is used, moment needs to be imported differently. // Since Moment.js doesn't have a default export, we normally need to import using the `* as` // syntax. However, rollup creates a synthetic default module and we thus need to import it using diff --git a/src/material-moment-adapter/adapter/moment-date-formats.ts b/src/material-moment-adapter/adapter/moment-date-formats.ts index df6569f5565..d4a86402c1f 100644 --- a/src/material-moment-adapter/adapter/moment-date-formats.ts +++ b/src/material-moment-adapter/adapter/moment-date-formats.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {MatDateFormats} from '@angular/material'; +import {MatDateFormats} from '@angular/material/core'; export const MAT_MOMENT_DATE_FORMATS: MatDateFormats = {