Skip to content

Commit 3551f96

Browse files
committed
example: Fix example on node 22 by removing json import
1 parent 6b053e0 commit 3551f96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/hello-world/esbuild.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { build } from 'esbuild';
2-
import { copyFileSync } from 'fs';
2+
import { copyFileSync, readFileSync } from 'fs';
33
import { resolve, dirname } from 'path';
44
import { fileURLToPath } from 'url';
55
import AdmZip from 'adm-zip';
6-
import metadata from './src/metadata.json' assert { type: 'json' };
76

87
const __dirname = dirname(fileURLToPath(import.meta.url));
8+
const metadata = JSON.parse(readFileSync('./src/metadata.json', 'utf8'));
99

1010
console.debug(`Building ${metadata.name} v${metadata.version}...`);
1111

0 commit comments

Comments
 (0)