Hi,
I’m trying to test my app in production mode in my browser. The app is meant to run on iPad but I just want to make sure some variables are set up properly in production mode.
My package.json looks like so:
"scripts": {
"start": "ionic serve",
"docs": ".\\node_modules\\.bin\\typedoc --out ./docs/ ./src/",
"clean": "ionic-app-scripts clean",
"build": "rimraf www && ionic-app-scripts build --aot --prod",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
}
When I run the npm run build
command, a www
folder is created in the root of my project. When I open the index.html
file in that folder, a few errors appear:
It looks like it can’t find a cordova.js
file and it also looks like it can’t properly enable prod mode.
My [DEVELOPMENT MODE]
line is called in a random config file I use:
import { isDevMode } from '@angular/core';
let apiConfig = {
apiUrl: '',
logAuthorizationToken: ''
};
if (isDevMode()) {
console.log('[DEVELOPMENT MODE]');
apiConfig = {
apiUrl: 'https://xxxxxxxx/xxx',
logAuthorizationToken: 'xxxxxxx'
};
} else {
console.log('[PRODUCTION MODE]');
apiConfig = {
apiUrl: 'https://xxxxxxxx/xxx',
logAuthorizationToken: 'xxxxxxx'
};
}
I must be missing something obvious, but I can’t really tell what.
Thank you for your help!