I have a ionic2 project containing more than 100 pages.when i run (ionic cordova build --prod) it throws the error-
<— Last few GCs —>
[9404:000001BEDA71B4F0] 242511 ms: Mark-sweep 1405.5 (1555.3) -> 1405.4 (1555.3) MB, 1322.0 / 0.0 ms allocation failure GC in old space requested
[9404:000001BEDA71B4F0] 243849 ms: Mark-sweep 1405.4 (1555.3) -> 1405.3 (1505.8) MB, 1337.3 / 0.0 ms last resort GC in old space requested
[9404:000001BEDA71B4F0] 245189 ms: Mark-sweep 1405.3 (1505.8) -> 1405.3 (1498.3) MB, 1339.0 / 0.0 ms last resort GC in old space requested
<— JS stacktrace —>
==== JS stack trace =========================================
Security context: 000000D9C22A5EE1
0: builtin exit frame: stringify(this=000000D9C2289041 ,0000006076582311 ,0000006076582311 ,00000186B56F7F61 )
1: arguments adaptor frame: 1->3
3: getText [C:\path\node_modules\@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:66227] [bytecode=00000317...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node_module_register
2: v8::internal::FatalProcessOutOfMemory
3: v8::internal::FatalProcessOutOfMemory
4: v8::internal::NewRawOneByteString
5: v8::internal::Smi::SmiPrint
6: v8::internal::AllocationSpaceName
7: v8::internal::interpreter::operator<<
8: v8::internal::interpreter::operator<<
9: v8::internal::interpreter::operator<<
10: v8::internal::Scope::ContextLocalCount
11: v8::internal::Scope::ContextLocalCount
12: 000000B84DD84561
Please help