公司项目用 vue3+vite+cesium
build 的时候总是提示内存不够,于是使用
"build": "node --max_old_space_size=4096 node_modules/vite/bin/vite.js build"
暂时解决问题
但是今天打包又提示内存不够了,甚至我分配多少吃多少,12g 满了还是失败
postcss-px-to-viewport: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migrationvite v3.2.7 building for production...
transforming (3074) node_modules\d3-array\src\constant.jsUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
✓ 3082 modules transformed.
<--- Last few GCs --->
[14884:000001F2FD8A4130] 123243 ms: Mark-sweep 11824.2 (12046.6) -> 11823.2 (12046.6) MB, 3763.9 / 0.0 ms (average mu = 0.633, current mu = 0.056) allocation failure scavenge might not succeed
[14884:000001F2FD8A4130] 129636 ms: Mark-sweep 11839.3 (12046.6) -> 11838.5 (12077.8) MB, 6387.8 / 0.0 ms (average mu = 0.366, current mu = 0.001) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF7BCB30AAF v8::internal::CodeObjectRegistry::~CodeObjectRegistry+124015
2: 00007FF7BCABC866 v8::internal::wasm::WasmCode::safepoint_table_offset+64182
3: 00007FF7BCABD8E2 v8::internal::wasm::WasmCode::safepoint_table_offset+68402
4: 00007FF7BD3F1CE4 v8::Isolate::ReportExternalAllocationLimitReached+116
5: 00007FF7BD3DC2AD v8::SharedArrayBuffer::Externalize+781
6: 00007FF7BD27F88C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
7: 00007FF7BD27C9A4 v8::internal::Heap::CollectGarbage+4244
8: 00007FF7BD27A320 v8::internal::Heap::AllocateExternalBackingStore+2000
9: 00007FF7BD29EEA6 v8::internal::Factory::NewFillerObject+214
10: 00007FF7BCFD1645 v8::internal::DateCache::Weekday+1797
11: 00007FF7BD47F9C1 v8::internal::SetupIsolateDelegate::SetupHeap+494417
12: 000001F2806E0C70
经验不足,找了半天也没找到如何分析哪里的问题,还请大手子教教我