fix(import): enable compatibility between ES modules and CommonJS for ical.jsRenamed ical.js to ical.cjs to explicitly mark it as a CommonJS module and used `createRequire` to import it into the ES module project. This resolves module system conflicts and ensures seamless integration without modifying ical.js content.
This commit is contained in:
parent
ad3ec6f7a6
commit
174a845c78
|
@ -15,8 +15,8 @@
|
|||
},
|
||||
"description": "calmerger",
|
||||
"main": "server.js",
|
||||
"type": "module",
|
||||
"author": "Ryan",
|
||||
"type": "module",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.26.0",
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
const ICAL = require('./ical.js');
|
||||
import { createRequire } from 'module';
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const ICAL = require('./ical.cjs');
|
||||
(function() {
|
||||
function register(tzdata) { ICAL.TimezoneService.register(ICAL.Component.fromString("BEGIN:VTIMEZONE\r\n" + tzdata + "\r\nEND:VTIMEZONE")) };
|
||||
ICAL.TimezoneService.IANA_TZDB_VERSION = "2024b";
|
||||
|
|
Loading…
Reference in New Issue