tabuckner / material-dayjs-adapter

A MatDateAdapter for Dayjs
https://www.npmjs.com/package/@tabuckner/material-dayjs-adapter
15 stars 23 forks source link

Import dayjs ESM module variants #70

Open netmikey opened 1 year ago

netmikey commented 1 year ago

In order to get rid of warnings like:

Warning: /node_modules/material-dayjs-adapter/fesm2020/tabuckner-material-dayjs-adapter.mjs depends on 'dayjs'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Replace all imports like

import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';

with the ESM module variants:

import dayjs from 'dayjs/esm';
import duration from 'dayjs/esm/plugin/duration';