Skip to content

Commit 762a341

Browse files
committed
add synthetic default export to moment
1 parent 2bec009 commit 762a341

File tree

9 files changed

+14
-3
lines changed

9 files changed

+14
-3
lines changed

src/demo-app/datepicker/moment-datepicker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ChangeDetectionStrategy, Component} from '@angular/core';
22
import {DateAdapter, MAT_DATE_LOCALE_PROVIDER, MD_DATE_FORMATS} from '@angular/material';
33
import {MomentDateAdapter, MD_MOMENT_DATE_FORMATS} from '@angular/material-moment-adapter';
4-
import * as moment from 'moment';
4+
import moment from 'moment';
55

66

77
@Component({

src/demo-app/tsconfig-aot.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{
55
"extends": "./tsconfig-build",
66
"compilerOptions": {
7+
// Needed for Moment.js since it doesn't have a default export.
8+
"allowSyntheticDefaultImports": true,
79
"experimentalDecorators": true,
810
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
911
"noUnusedParameters": false,

src/demo-app/tsconfig-build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// since the demo-app will be served in the browser.
33
{
44
"compilerOptions": {
5+
// Needed for Moment.js since it doesn't have a default export.
6+
"allowSyntheticDefaultImports": true,
57
"declaration": false,
68
"emitDecoratorMetadata": true,
79
"experimentalDecorators": true,

src/material-moment-adapter/adapter/moment-date-adapter.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {MomentDateAdapter} from './moment-date-adapter';
1010
import {async, inject, TestBed} from '@angular/core/testing';
1111
import {MomentDateModule} from './index';
1212
import {DateAdapter, MAT_DATE_LOCALE} from '@angular/material';
13-
import * as moment from 'moment';
13+
import moment from 'moment';
1414
import {LOCALE_ID} from '@angular/core';
1515

1616

src/material-moment-adapter/adapter/moment-date-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {Inject, Injectable, Optional} from '@angular/core';
1010
import {DateAdapter, MAT_DATE_LOCALE} from '@angular/material';
11-
import * as moment from 'moment';
11+
import moment from 'moment';
1212

1313

1414
/** Creates an array and fills it with values. */

src/material-moment-adapter/tsconfig-build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// needs to be ES2015 since the build process will create FESM bundles using rollup.
33
{
44
"compilerOptions": {
5+
// Needed for Moment.js since it doesn't have a default export.
6+
"allowSyntheticDefaultImports": true,
57
"baseUrl": ".",
68
"declaration": true,
79
"stripInternal": false,

src/material-moment-adapter/tsconfig-tests.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{
55
"extends": "./tsconfig-build",
66
"compilerOptions": {
7+
// Needed for Moment.js since it doesn't have a default export.
8+
"allowSyntheticDefaultImports": true,
79
"importHelpers": false,
810
"module": "commonjs",
911
"target": "es5",

tools/package-tools/rollup-globals.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const rollupCdkEntryPoints = cdkSecondaryEntryPoints.reduce((globals: any, entry
1717
/** Map of globals that are used inside of the different packages. */
1818
export const rollupGlobals = {
1919
'tslib': 'tslib',
20+
'moment': 'moment',
2021

2122
'@angular/animations': 'ng.animations',
2223
'@angular/core': 'ng.core',

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// IDEs and TSLint. For IDEs it ensures that `experimentalDecorator` warnings are not showing up.
33
{
44
"compilerOptions": {
5+
// Needed for Moment.js since it doesn't have a default export.
6+
"allowSyntheticDefaultImports": true,
57
"rootDir": ".",
68
"experimentalDecorators": true,
79
"module": "es2015",

0 commit comments

Comments
 (0)