Skip to content

Commit 09fd6ac

Browse files
committed
Try fix memory errors during build
1 parent f4e246a commit 09fd6ac

15 files changed

+3761
-17
lines changed

.github/workflows/node.js.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ jobs:
3030
cache: 'npm'
3131
cache-dependency-path: 'frontend/package-lock.json'
3232
- run: npm ci
33-
- run: NODE_OPTIONS=--max_old_space_size=8192 npm run build --if-present
33+
- run: npm run tsc
34+
- run: npm run vite:build
3435
- run: npm run test --if-present

app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ async def index():
7070
async def favicon():
7171
return await bp.send_static_file("favicon.ico")
7272

73+
@bp.route("/mslearnguy.png")
74+
async def mslearnguy():
75+
return await bp.send_static_file("mslearnguy.png")
76+
7377
@bp.route("/assets/<path:path>")
7478
async def assets(path):
7579
return await send_from_directory("static/assets", path)

frontend/dist/tsconfig.tsbuildinfo

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

frontend/package-lock.json

Lines changed: 31 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "frontend",
3-
"private": true,
4-
"version": "0.0.0",
5-
"type": "module",
3+
"version": "1.0.0",
64
"scripts": {
75
"dev": "vite",
8-
"build": "tsc && vite build",
9-
"watch": "tsc && vite build --watch",
6+
"tsc": "cross-env NODE_OPTIONS=--max_old_space_size=16384 tsc",
7+
"vite:build": "cross-env NODE_OPTIONS=--max_old_space_size=16384 vite build",
8+
"build": "npm run tsc && npm run vite:build",
9+
"watch": "cross-env NODE_OPTIONS=--max_old_space_size=16384 tsc --watch",
1010
"test": "jest",
1111
"lint": "npx eslint src",
1212
"lint:fix": "npx eslint --fix",
@@ -15,10 +15,10 @@
1515
"format": "npm run prettier:fix && npm run lint:fix"
1616
},
1717
"dependencies": {
18-
"axios": "^1.7.2",
1918
"@fluentui/react": "^8.105.3",
2019
"@fluentui/react-hooks": "^8.6.29",
2120
"@fluentui/react-icons": "^2.0.195",
21+
"axios": "^1.7.2",
2222
"dompurify": "^3.0.8",
2323
"lodash": "^4.17.21",
2424
"lodash-es": "^4.17.21",
@@ -35,9 +35,9 @@
3535
"remark-supersub": "^1.0.0"
3636
},
3737
"devDependencies": {
38-
"@types/axios": "^0.14.0",
3938
"@eslint/eslintrc": "^3.0.2",
4039
"@eslint/js": "^9.1.1",
40+
"@types/axios": "^0.14.0",
4141
"@types/dompurify": "^3.0.5",
4242
"@types/eslint-config-prettier": "^6.11.3",
4343
"@types/jest": "^29.5.12",
@@ -51,6 +51,7 @@
5151
"@typescript-eslint/eslint-plugin": "^6.21.0",
5252
"@typescript-eslint/parser": "^6.21.0",
5353
"@vitejs/plugin-react": "^3.1.0",
54+
"cross-env": "^7.0.3",
5455
"eslint": "^8.57.0",
5556
"eslint-config-prettier": "^9.1.0",
5657
"eslint-config-standard-with-typescript": "^43.0.1",
@@ -72,4 +73,4 @@
7273
"typescript": "^4.9.5",
7374
"vite": "^4.1.5"
7475
}
75-
}
76+
}

frontend/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"noEmit": true,
1717
"jsx": "react-jsx",
1818
"types": ["vite/client", "jest", "mocha"],
19-
"noUnusedLocals": false
19+
"noUnusedLocals": false,
20+
"incremental": true, // Enable incremental builds
21+
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo" // Store incremental build infoEnable incremental builds
2022
},
2123
"include": ["src"],
2224
"references": [{ "path": "./tsconfig.node.json" }]

frontend/vite.config.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
import react from '@vitejs/plugin-react'
2-
import { defineConfig } from 'vite'
1+
import react from '@vitejs/plugin-react';
2+
import { defineConfig } from 'vite';
33

4-
// https://vitejs.dev/config/
54
export default defineConfig({
65
plugins: [react()],
76
build: {
87
outDir: '../static',
98
emptyOutDir: true,
10-
sourcemap: true
9+
sourcemap: true,
10+
rollupOptions: {
11+
output: {
12+
manualChunks: {
13+
vendor: ['react', 'react-dom']
14+
}
15+
}
16+
}
1117
},
1218
server: {
1319
proxy: {
1420
'/ask': 'http://localhost:5000',
1521
'/chat': 'http://localhost:5000'
1622
}
1723
}
18-
})
24+
});

static/assets/Contoso-ff70ad88.svg

Lines changed: 25 additions & 0 deletions
Loading

static/assets/Send-d0601aaa.svg

Lines changed: 10 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)