Fellow Ionites
I run onto the following problem and I’m not able to build for production.
running:
ionic build android
or even
ionic build android --aot --release
my apk package is build successfully
If I run
ionic build android --prod --release
then build fails at uglify
Here’s the result:
[23:23:09] ionic-app-scripts 1.1.4
[23:23:09] build prod started ...
[23:23:09] clean started ...
[23:23:09] clean finished in 6 ms
[23:23:09] copy started ...
[23:23:09] ngc started ...
[23:23:44] ngc finished in 34.35 s
[23:23:44] preprocess started ...
[23:23:44] optimization started ...
[23:23:46] copy finished in 36.46 s
[23:24:03] optimization finished in 19.17 s
[23:24:03] preprocess finished in 19.17 s
[23:24:03] webpack started ...
[23:25:06] webpack finished in 63.46 s
[23:25:06] sass started ...
[23:25:06] transpile bundle started ...
[23:25:35] transpile bundle finished in 28.57 s
[23:25:35] uglifyjs started ...
[23:25:37] sass finished in 30.63 s
[23:25:37] cleancss started ...
[23:25:46] cleancss finished in 9.59 s
[23:26:00] uglifyjs failed: ENOENT: no such file or directory, open
'<my-path>\www\build\main.js.map'
[23:26:00] ionic-app-script task: "build"
[23:26:00] Error: ENOENT: no such file or directory, open
'<my-path>\www\build\main.js.map'
Error: ENOENT: no such file or directory, open '<my-path>\www\build\main.js.map'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Object.exports.minify (<my-path>\node_modules\uglify-js\tools\node.js:120:31)
at runUglifyInternal (<my-path>\node_modules\@ionic\app-scripts\dist\uglifyjs.js:47:19)
at <my-path>\node_modules\@ionic\app-scripts\dist\uglifyjs.js:31:32
at uglifyjsWorker (<my-path>\node_modules\@ionic\app-scripts\dist\uglifyjs.js:22:12)
at process.<anonymous> (<my-path>\node_modules\@ionic\app-scripts\dist\worker-process.js:8:9)
at emitTwo (events.js:106:13)
at process.emit (events.js:191:7)
It was happening with Ionic 2.1.1. Upgrading to 2.2.0 did not help.
Still getting the same issue.
Any ideas? how to troubleshoot this?
Many thanks in advance.
Costas