Unable to build webapp now

I have a project that I have created with ionic v2, and am first deploying it as a web-app, later to be encapsulated as ios and android apps. To do this I have been using ionic build, with no platform specified, to create a minified and uglified www folder, reducing the size by almost 75% and improving load times.

After some upgrades to node.js I was having some trouble building, so I upgraded ionic as well. I am currently running 3.2.0.

The problem is that ionic build is no longer supported. It has been replaced by ionic package build, and that now requires a platform, which seems to be limited to ios or android, and both of those now require that I create a security profile!

I just want to create the minified, uglified www folder. Is there a way to do that now, or has that gone away?

Thanks for any tips or pointers.

Have you tried

ionic cordova build browser --prod

1 Like

Thank you. This ultimately worked.

I did have a weird problem with an obscure error message. It looked like there was a symlink in node_modules called web that pointed to itself. When I deleted it, and made a new directory there called web, everything worked.

I’m not a big fan of the cordova browser platform, and you shouldn’t have to be either. Depending on ionic CLI version, either npm run ionic:build or ionic build should work for your purposes.

I can’t find ionic build in the documentation. I only can find ionic cordova build.

Upgrade to the newest version, no need to stay with this old one.

That is not correct. The old build is now cordova build. package is the cloud version of cordova build and for another use case.

The build without a platform was npm run ionic:build for some time now, but Ionic CLI 3.7 re-added ionic build as you want to use it. (That’s why updating to the most recent version makes sense!) It also takes --prod for an optimized production build.

Documentation doesn’t seem to have been updated yet. But it is there and works perfectly:

Would you care to elaborate? What are the drawbacks of using cordova browser platform?