Skip to content

Commit f394dd4

Browse files
committed
use moment-timezone build
1 parent 6080afb commit f394dd4

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/api/build.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import esbuild from "esbuild";
2+
import { resolve } from "path";
23

34
esbuild
45
.build({
@@ -16,7 +17,10 @@ esbuild
1617
target: "es2022", // Target ES2022
1718
sourcemap: false,
1819
platform: "node",
19-
external: ["aws-sdk", "moment-timezone","passkit-generator", "fastify"],
20+
external: ["aws-sdk", "moment-timezone", "passkit-generator", "fastify"],
21+
alias: {
22+
'moment-timezone': resolve(process.cwd(), '../../node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js')
23+
},
2024
banner: {
2125
js: `
2226
import path from 'path';

src/api/esbuild.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ const buildOptions = {
1919
loader: {
2020
'.png': 'file', // Add this line to specify a loader for .png files
2121
},
22+
alias: {
23+
'moment-timezone': resolve(process.cwd(), '../../node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js')
24+
},
25+
banner: {
26+
js: `
27+
import path from 'path';
28+
import { fileURLToPath } from 'url';
29+
import { createRequire as topLevelCreateRequire } from 'module';
30+
const require = topLevelCreateRequire(import.meta.url);
31+
const __filename = fileURLToPath(import.meta.url);
32+
const __dirname = path.dirname(__filename);
33+
`.trim(),
34+
}, // Banner for compatibility with CommonJS
2235
};
2336

2437
if (isWatching) {

tests/live/ical.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { expect, test } from "vitest";
2-
import { InternalServerError } from "../../src/common/errors/index.js";
32
import { describe } from "node:test";
43
import { OrganizationList } from "../../src/common/orgs.js";
54
import ical from "node-ical";

0 commit comments

Comments
 (0)