I’ve built an app intended for deployment to about 150 people and want to make it available directly to web browsers through a static web site. So far I’ve been copying the www directory to a static location on Amazon S3 and serving it from there. Seems to work great.
Is this the way to deploy mobile web apps?
Are there any command-line build options to:
- optimize (package) the www directory
- obsfucate the content
Thanks in advance.
Just do npm run ionic:build --prod
before uploading your www
folder.
Thank you. I’m curious - where was that described in the documentation? I tried it just now and it’s not liking my use of Firebase…
npm run ionic:build --prod
> esfr-overtime@ ionic:build /Users/eyejot/development/ionic/Overtime
> ionic-app-scripts build
keywords if/then/else require v5 option
[12:29:37] ionic-app-scripts 0.0.48-201612291559
[12:29:37] build prod started ...
[12:29:37] clean started ...
[12:29:37] clean finished in 8 ms
[12:29:37] copy started ...
[12:29:37] ngc started ...
[12:29:39] build prod failed: Error encountered resolving symbol values statically. Calling function 'defaultFirebase',
function calls are not supported. Consider replacing the function or lambda with a reference to an exported
function, resolving symbol MyApp in /Users/eyejot/development/ionic/Overtime/src/app/app.component.ts,
resolving symbol MyApp in /Users/eyejot/development/ionic/Overtime/src/app/app.component.ts
[12:29:39] ionic-app-script task: "build"
[12:29:39] Error: Error encountered resolving symbol values statically. Calling function 'defaultFirebase', function
calls are not supported. Consider replacing the function or lambda with a reference to an exported function,
resolving symbol MyApp in /Users/eyejot/development/ionic/Overtime/src/app/app.component.ts, resolving
It’s in the Ionic App Scripts project.
The error you’re getting is probably something to do with the Angular Ahead-of-Time template compilation, that’s only enabled with the --prod
flag. Although I’m not sure what the fix is.
Most of the forum search results for “lambda” will probably help you with that.