File tree Expand file tree Collapse file tree 6 files changed +4448
-9637
lines changed Expand file tree Collapse file tree 6 files changed +4448
-9637
lines changed Original file line number Diff line number Diff line change 28
28
cd ./docs/
29
29
pm2 restart graphql-debugger.com
30
30
cd ../apps/ui
31
- DEMO_MODE=true pnpm build
31
+ NODE_ENV=production DEMO_MODE=true pnpm build
32
32
pm2 restart demo
Original file line number Diff line number Diff line change 18
18
"dev" : " cross-env TRACE_SCHEMA=true TRACE_PRISMA=true TRACE_EXPRESS=true ts-node ./src/main.ts"
19
19
},
20
20
"dependencies" : {
21
- "@graphql-debugger/client" : " workspace:^" ,
22
21
"@graphql-debugger/adapter-sqlite" : " workspace:^" ,
22
+ "@graphql-debugger/client" : " workspace:^" ,
23
23
"@graphql-debugger/graphql-schema" : " workspace:^" ,
24
24
"@graphql-debugger/plugin-express" : " workspace:^" ,
25
25
"@graphql-debugger/ui" : " workspace:^" ,
26
26
"@graphql-debugger/utils" : " workspace:^" ,
27
27
"cors" : " 2.8.5" ,
28
- "express" : " 4.19.2"
28
+ "express" : " 4.19.2" ,
29
+ "express-static-gzip" : " 2.1.7"
29
30
},
30
31
"devDependencies" : {
31
32
"@types/cors" : " 2.8.17" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { graphqlDebugger } from "@graphql-debugger/plugin-express";
4
4
5
5
import cors from "cors" ;
6
6
import express , { Express } from "express" ;
7
+ import expressStaticGzip from "express-static-gzip" ;
7
8
import http from "http" ;
8
9
import path from "path" ;
9
10
@@ -30,7 +31,12 @@ export async function start({
30
31
client,
31
32
} ) ,
32
33
) ;
33
- app . use ( express . static ( path . join ( __dirname , "../../ui/build" ) ) ) ;
34
+ app . use (
35
+ "/" ,
36
+ expressStaticGzip ( path . join ( __dirname , "../../ui/build" ) , {
37
+ enableBrotli : true ,
38
+ } ) ,
39
+ ) ;
34
40
app . use ( express . static ( "public" ) ) ;
35
41
36
42
const server = await app . listen ( port ) ;
Original file line number Diff line number Diff line change 47
47
},
48
48
"devDependencies" : {
49
49
"@faker-js/faker" : " 8.4.1" ,
50
- "@graphql-debugger/types" : " workspace:^"
50
+ "@graphql-debugger/types" : " workspace:^" ,
51
+ "compression-webpack-plugin" : " 11.1.0"
51
52
},
52
53
"engines" : {
53
54
"node" : " >=18" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
4
4
const CopyWebpackPlugin = require ( "copy-webpack-plugin" ) ;
5
5
const { CleanWebpackPlugin } = require ( "clean-webpack-plugin" ) ;
6
6
const NodePolyfillPlugin = require ( "node-polyfill-webpack-plugin" ) ;
7
+ const CompressionPlugin = require ( "compression-webpack-plugin" ) ;
7
8
8
9
module . exports = {
9
10
mode : "none" ,
@@ -73,6 +74,13 @@ module.exports = {
73
74
favicon : "./public/favicon.svg" ,
74
75
} ) ,
75
76
new NodePolyfillPlugin ( ) ,
77
+ ...( process . env . NODE_ENV === "production"
78
+ ? [
79
+ new CompressionPlugin ( {
80
+ deleteOriginalAssets : true ,
81
+ } ) ,
82
+ ]
83
+ : [ ] ) ,
76
84
] ,
77
85
devServer : {
78
86
static : {
You can’t perform that action at this time.
0 commit comments