What is the proper way to build a ionic2 web app without cordova


#1

i start the ionic2 project using -w parameter, to get a web-app with no cordova.
but how could i release it? i can not build the project. i could run ionic serve, and copy every thing in www folder to the server, it is work but the main.js is too large, and it still has the error of Failed to load resource cordova.js


#2

I’m in this situation, too. For the error of Failed to load ‘cordova.js’, you can remove the code which to load ‘cordova.js’ in ‘index.html’.

But I want to know what can I do for main.js’s problem.:worried:


#3

i ended up with start the standard cordova ionic project, and add the browser platform at last.
it can build and everything works fine.
but i still wander why there is a -w parameter when start a ionic2 project, if we can not release it ever…


#4

I’m going crazy… I rebuild the project with -w, and run ionic build browser. But the files in www are the same to before. main.js is still 5M+. What have I done wrong? Could you help me!!:sob:


#5

do not start the project use -w
just start a normal cordova ionic2 project
ionic start --v2 xxx blank
then add browser platform
ionic platform add browser
then build
ionic build browser --release


#6

Thank you very much. it’s worked. main.js is just 1.6M now.