Skip to content

Commit 5c413ec

Browse files
committed
Build fixes & improvements
1 parent 40bbc06 commit 5c413ec

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
],
1414
"scripts": {
1515
"start": "./bin/run",
16-
"prepublishOnly": "rm -rf lib && tsc -b",
16+
"build": "rm -rf lib && tsc -b",
17+
"prepack": "npm run build",
1718
"test": "mocha -r ts-node/register 'test/**/*.spec.ts'"
1819
},
1920
"repository": "httptoolkit/httptoolkit-server",

src/httptoolkit-server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { GraphQLScalarType } from 'graphql';
55
import { HtkConfig } from './config';
66
import { buildInterceptors, Interceptor } from './interceptors';
77

8+
const packageJson = require('../package.json');
9+
810
const typeDefs = `
911
type Query {
1012
version: String!
@@ -38,7 +40,7 @@ const typeDefs = `
3840
const buildResolvers = (interceptors: _.Dictionary<Interceptor>) => {
3941
return {
4042
Query: {
41-
version: async () => (await import('../package.json')).version,
43+
version: () => packageJson.version,
4244
interceptors: () => _.values(interceptors),
4345
},
4446

0 commit comments

Comments
 (0)