mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Mobile: Fix dayjs-related startup error (#10652)
This commit is contained in:
parent
94edaea210
commit
1d46adf801
@ -4,7 +4,12 @@
|
|||||||
// -----------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
import * as dayjs from 'dayjs';
|
import * as dayjs from 'dayjs';
|
||||||
import * as dayJsRelativeTime from 'dayjs/plugin/relativeTime';
|
|
||||||
|
// Separating this into a type import and a require seems to be necessary to support mobile:
|
||||||
|
// - import = require syntax doesn't work when bundling
|
||||||
|
// - import * as dayJsRelativeTimeType causes a runtime error.
|
||||||
|
import type * as dayJsRelativeTimeType from 'dayjs/plugin/relativeTime';
|
||||||
|
const dayJsRelativeTime: typeof dayJsRelativeTimeType = require('dayjs/plugin/relativeTime');
|
||||||
|
|
||||||
const supportedLocales: Record<string, unknown> = {
|
const supportedLocales: Record<string, unknown> = {
|
||||||
'ar': require('dayjs/locale/ar'),
|
'ar': require('dayjs/locale/ar'),
|
||||||
|
Loading…
Reference in New Issue
Block a user