Ionic 4 Prod build failed due to ERROR in Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):

Hi all,

I am trying to build ionic 4 project for production. It has been working fine in dev but when i ran -
ionic cordova build ios --prod. The error is -

ERROR in Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
TypeError: Cannot read property ‘replace’ of undefined
at normalizeBackSlashDirection (/Users/shopupp-ionic/node_modules/webpack/lib/RequestShortener.js:16:17)
at new RequestShortener (/Users/node_modules/webpack/lib/RequestShortener.js:26:15)
at new Compiler (/Users/node_modules/webpack/lib/Compiler.js:185:27)
at Compiler.createChildCompiler (/Users/node_modules/webpack/lib/Compiler.js:508:25)
at Compilation.createChildCompiler (/Users/node_modules/webpack/lib/Compilation.js:2494:24)
at Object.pitch (/Users/node_modules/mini-css-extract-plugin/dist/loader.js:70:43)
[ERROR] An error occurred while running subprocess ng.

Has anyone faced this issue ? Will really appreciate any help. Thanks