Skip to content

Commit

Permalink
Fix build OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
abrenneke committed Oct 10, 2023
1 parent a51d16f commit 989c2f5
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ packages/app-executor/bin/executor-bundle.js
.turbo

.idea

packages/app/stats.html
34 changes: 34 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react-hooks": "^4.6.0",
"execa": "^8.0.1",
"rollup-plugin-visualizer": "^5.9.2",
"semver": "^7.5.4",
"tsx": "^3.12.7"
}
Expand Down
15 changes: 14 additions & 1 deletion packages/app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import svgr from 'vite-plugin-svgr';
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
import topLevelAwait from 'vite-plugin-top-level-await';
import { resolve } from 'node:path';
import { visualizer } from 'rollup-plugin-visualizer';
import { splitVendorChunkPlugin } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
optimizeDeps: {
exclude: ['@ironclad/rivet-core', '@ironclad/trivet'],
exclude: ['@ironclad/rivet-core', '@ironclad/trivet', 'gpt-tokenizer'],
},
resolve: {
preserveSymlinks: true,
Expand All @@ -21,6 +23,16 @@ export default defineConfig({
},
build: {
chunkSizeWarningLimit: 10000,
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('gpt-tokenizer')) {
return 'gpt-tokenizer';
}
},
},
plugins: [visualizer()],
},
},
plugins: [
react(),
Expand All @@ -33,5 +45,6 @@ export default defineConfig({
// Bad ESM
(monacoEditorPlugin as any).default({}),
topLevelAwait(),
splitVendorChunkPlugin(),
],
});
29 changes: 28 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4236,6 +4236,7 @@ __metadata:
recoil-persist: "npm:^5.1.0"
retry: "npm:^0.13.1"
rollup: "npm:^3.27.0"
rollup-plugin-visualizer: "npm:^5.9.2"
safe-stable-stringify: "npm:^2.4.3"
semver: "npm:^7.5.4"
ts-dedent: "npm:^2.2.0"
Expand Down Expand Up @@ -15626,6 +15627,25 @@ __metadata:
languageName: node
linkType: hard

"rollup-plugin-visualizer@npm:^5.9.2":
version: 5.9.2
resolution: "rollup-plugin-visualizer@npm:5.9.2"
dependencies:
open: "npm:^8.4.0"
picomatch: "npm:^2.3.1"
source-map: "npm:^0.7.4"
yargs: "npm:^17.5.1"
peerDependencies:
rollup: 2.x || 3.x
peerDependenciesMeta:
rollup:
optional: true
bin:
rollup-plugin-visualizer: dist/bin/cli.js
checksum: 4aab6a29defac30eb97ea849525dcc239dc6ae5da4adbbb549a5eefa96fef353ef9bf97b894c0d2a77c18d94274002df55af2d5ee6ff703ffb6b7b94f9878bb4
languageName: node
linkType: hard

"rollup@npm:^3.25.2, rollup@npm:^3.27.0":
version: 3.27.0
resolution: "rollup@npm:3.27.0"
Expand Down Expand Up @@ -16197,6 +16217,13 @@ __metadata:
languageName: node
linkType: hard

"source-map@npm:^0.7.4":
version: 0.7.4
resolution: "source-map@npm:0.7.4"
checksum: 97353dd6ffe747221f810400254a2c0110d745758aa094d3efe697d15c7697bb9bf49fea7028e88e97f973af53ac98cf69522ced606a4b46428fdd3e0d759280
languageName: node
linkType: hard

"space-separated-tokens@npm:^1.0.0":
version: 1.1.5
resolution: "space-separated-tokens@npm:1.1.5"
Expand Down Expand Up @@ -18172,7 +18199,7 @@ __metadata:
languageName: node
linkType: hard

"yargs@npm:^17.7.2":
"yargs@npm:^17.5.1, yargs@npm:^17.7.2":
version: 17.7.2
resolution: "yargs@npm:17.7.2"
dependencies:
Expand Down

0 comments on commit 989c2f5

Please sign in to comment.