mirror of
https://github.com/acamarata/dayjs-hijri-plus.git
synced 2026-06-30 18:54:26 +00:00
Day.js plugin adding Hijri calendar support via hijri-core. Adds toHijri(), fromHijri(), hijriYear/Month/Day(), isValidHijri(), and formatHijri() to all Day.js instances. Supports UAQ and FCNA calendars via ConversionOptions. Format token escaping wraps substituted values in Day.js bracket syntax to prevent re-interpretation as format tokens. 14 ESM + 8 CJS tests passing. Dual CJS/ESM build.
17 lines
376 B
TypeScript
17 lines
376 B
TypeScript
import { defineConfig } from 'tsup';
|
|
|
|
export default defineConfig({
|
|
entry: ['src/index.ts'],
|
|
format: ['cjs', 'esm'],
|
|
dts: true,
|
|
clean: true,
|
|
outDir: 'dist',
|
|
splitting: false,
|
|
sourcemap: true,
|
|
target: 'es2020',
|
|
platform: 'node',
|
|
external: ['dayjs', 'hijri-core'],
|
|
outExtension({ format }) {
|
|
return { js: format === 'esm' ? '.mjs' : '.cjs' };
|
|
},
|
|
});
|