0.0.47
Upgrade Instructions
Install latest Ionic CLI
Install the latest ionic cli. sudo
may be required depending upon your npm
set-up.
npm install -g ionic@latest
Entry Point Changes
Delete main.dev.ts
and main.prod.ts
and create a main.ts
file with the following content:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
Dev Builds By Default Changes
All builds are now development (non-AoT) builds by default. This allows for a better development experience when testing on a device. To get started, please follow the steps below.
Make sure the script
section of package.json
looks like this:
"scripts": {
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
}
ionic run android --prod
will do a production build that utilizes AoT compiling and minifaction.
ionic emulate ios --prod
will do a production build that utilizes AoT compiling and minifaction.
ionic run android
will do a development build
ionic emulate ios
will do a development build
If you wish to run AoT but disable minifaction, do the following
ionic run android --aot
ionic emulate ios --aot
Source Map Changes
Change ionic_source_map
to ionic_source_map_type
in package.json if it is overridden.
Config Changes
There were significant improvements/changes to most configs. Please review the changes and make sure any custom configs are up to date.
Validate TSConfig settings
Verify that tsconfig.json
is up to date with recommended settings:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"dom",
"es2015"
],
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"target": "es5"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"compileOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
Breaking Changes
main.dev.ts
andmain.prod.ts
have been deprecated in favor ofmain.ts
with the content ofmain.dev.ts
. The content ofmain.ts
will be optimized at build time for production builds.- Builds are now always development (non-AoT) by default. To enable
prod
builds, use the--prod
option. copy.config
andwatch.config
have breaking changes moving to an easier-to-extend configuration style.copy.config
usesnode-glob
instead offs-extra
to do the copy. Migrate from directory/files to globs in any custom configs.ionic_source_map
configuration has been changed toionic_source_map_type
.- Source maps now use
source-map
devtool option by default instead ofeval
. Changeionic_source_map_type
option to return to the faster buildingeval
.
Bug Fixes
- AoT: dynamically enable prod mode for AoT builds (0594803)
- AoT: use in-memory data store instead of .tmp directory for AoT codegen (93106ff)
- build: every build should run clean sync and copy async. (6d4eb6e)
- copy: Resolve race condition in copy task, move to glob config (cc99a73)
- lab: add lab to files (f42c980)
- livereload: livereload now correctly serves cordova plugins on run and emulate. (a0c3f5d)
- livereload: on project build all pages connected should reload. (#513) (62d6b23)
- livereload: use localhost instead of 0.0.0.0 when injecting live reload script (#450) (7f8a0c3)
- logging: remove unnecessary websocket error msg, clean up copy error msg (1517b06)
- ngc: simpler AoT error reporting (1b0f163)
- serve: add flag to indicate to serve for a cordova app (93782e7)
- source-maps: use detailed source-map as default, fix windows path issue (19464b3)
- workers: generate context in worker threads (af036ec)
Features
- build: replace --dev flag with --prod and add flags --aot, --minifyJs, --minifyCss, --optimizeJs (99922ce)
- bundle: pre and post bundle hooks (4835550)
- copy: update copy config to move web workers (a909fc4)
- lab: fresh coat of paint (edb6f09)
- replacePathVars: support interpolation of objects and arrays (#449) (e039d46)
- all arguments passed should be compared as case insensitive (085c897)