angular-rollup
2.0.0-beta.0
cli for building angular apps
2.0.0-beta.0 is the next generation of angular-rollup. 2.0.0 will be released once we reach feature parity with 1.x.
Currently only a few commands are supported.
ngr scaffold
ngr build prod
ngr build dev --watch
ngr build jit
How To Update
npm install -g angular-rollup@2.0.0-beta.0
ngr --help
There are new cli arguments. Review the changes by running ngr --help
.
Report Issues
https://github.com/steveblue/angular2-rollup/issues
Not All Builds Are Fully Operational
2.0.0-beta currently only supports building a single bundle. Lazyloading, Universal, Electron, and i18n are not yet ready for consumption. If your app relies on any of these builds, stay with 1.x until these features are rolled into 2.0.0-beta.
Upgrade Existing Project
The easiest way to upgrade is to scaffold a new app (ngr scaffold
) and overwrite the ngr.config.json
and src
directory with the old.
2.0.0-beta.0
- All new build architecture allows for easier maintainance, human readibility
- 4x faster builds in some cases
- Fixed an issue that prevented styles from compiling in library builds
IMPROVEMENTS
- Add
src/style/**/*.scss
and src/style/**/*.css
to excludes
Array in tsconfig.dev.json. This will force ngc to ignore global styles and prevent compilation. Updates to global styling can now happen without browser reload. - Deprecated requirement for Babel in library build
BREAKING CHANGES
main.js
, main.prod.js
and main.prod.ts
are now deprecated. These files can be removed. The build now automatically handles main.ts
for dev and jit builds.- Upgrade
rollup
to ^0.55.0
. The library build now supports input
and output
syntax by default - Arguments passed to buildHooks and server.js may change, please check and update where necessary
For example, in previous scaffolds server.js
contained this conditional checking for --watch
but canWatch
supposes there is an =
. In 2.0.0 only watch
is exposed, not anything after the =
:
BEFORE:
if (arg.includes('watch')) {
canWatch = arg.split('=')[1].trim() === 'true' ? true : false;
}
AFTER:
if (arg.includes('watch')) {
canWatch = true;
}
- Change the model for declaring library packages in
ngr.config.js
. The new config should look like this:
BEFORE:
dep: {
lib: [],
prodLib: []
}
AFTER:
lib: {
dev: [],
prod: []
}