Skip to content

Commit 6a78e12

Browse files
committed
Update Node engine to 24, modernize TS and Webpack config
1 parent 5dd4fff commit 6a78e12

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://github.com/graphql-kit/graphql-voyager/issues"
1515
},
1616
"engines": {
17-
"node": ">=20.0.0"
17+
"node": ">=24.0.0"
1818
},
1919
"main": "dist/voyager.lib.js",
2020
"types": "typings/index.d.ts",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"skipLibCheck": true,
2222
// end copy
2323

24-
"module": "es2015",
24+
"resolveJsonModule": true,
25+
"module": "esnext",
2526
"moduleResolution": "node",
2627
"target": "es2021",
2728
"allowSyntheticDefaultImports": true,

webpack.config.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import 'webpack-dev-server';
22

3-
import * as path from 'node:path';
3+
import path from 'node:path';
44

5-
import * as MiniCssExtractPlugin from 'mini-css-extract-plugin';
6-
import * as webpack from 'webpack';
7-
import { ExternalItemFunctionData } from 'webpack';
5+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
6+
import type { ExternalItemFunctionData } from 'webpack';
7+
import webpack from 'webpack';
88

9-
// eslint-disable-next-line @typescript-eslint/no-require-imports
10-
const packageJSON = require('./package.json');
9+
import packageJSON from './package.json' with { type: 'json' };
1110
const BANNER = `GraphQL Voyager - Represent any GraphQL API as an interactive graph
1211
-------------------------------------------------------------
1312
Version: ${packageJSON.version}
@@ -22,7 +21,7 @@ const baseConfig: webpack.Configuration = {
2221
alias: { '../../worker': '../../worker-dist' },
2322
},
2423
output: {
25-
path: path.resolve(__dirname, 'dist'),
24+
path: path.join(import.meta.dirname, 'dist'),
2625
sourceMapFilename: '[file].map',
2726
library: 'GraphQLVoyager',
2827
libraryTarget: 'umd',
@@ -114,7 +113,7 @@ const config: Array<webpack.Configuration> = [
114113
devServer: {
115114
port: 9090,
116115
static: {
117-
directory: path.join(__dirname, 'demo'),
116+
directory: path.join(import.meta.dirname, 'demo'),
118117
},
119118
liveReload: true,
120119
},

0 commit comments

Comments
 (0)