Plugin import in angular project throws error 'no default export'
See original GitHub issueDescribe the bug
Plugin import throws error in angular project / browser
dayjs__WEBPACK_IMPORTED_MODULE_5__(...).month(...).startOf(...).weekday is not a function
Expected behavior
I can use most dayjs functions just fine with import * as dayjs from 'dayjs'.
But when I need to use plugins, I import with import * as weekday from 'dayjs/plugin/weekday, it throws me this error in the browser - even though the compiler recognises the function weekday just fine:
dayjs__WEBPACK_IMPORTED_MODULE_5__(...).month(...).startOf(...).weekday is not a function

Trying to import the weekday plugin with import weekday from 'dayjs/plugin/weekday';  throws compiler error Module '"C:/.../node_modules/dayjs/plugin/weekday"' has no default export.
OR import { weekday } from 'dayjs/plugin/weekday';  throws compiler error Module '"C:/.../node_modules/dayjs/plugin/weekday"' has no exported member
Information
- Day.js Version 1.8.14
 - OS: Win 10 / Angular Typescript Project
 - Browser Chrome 74
 
Issue Analytics
- State:
 - Created 4 years ago
 - Reactions:1
 - Comments:6 (3 by maintainers)
 

Top Related StackOverflow Question
Use
dayjs.extend, see docI’ll close this issue since it’s been a while since it’s been opened. Feel free to reopen if you have updates on this