angular-rollup
Advanced tools
Changelog
2.0.0-rc.5
--env
in development buildprod
in prod buildChangelog
2.0.0-rc.4
--prettier
argument to scaffold a new app with prettier and installs a precommit hook--ssl
argument to scaffold a new app with https express serverNOTE: Running the https express server requires a public key and certificate. Generate key.pem
and cert.pem
and save in the backend
directory.
Changelog
2.0.0-rc.3
<title>
tag properlyNOTE: This version contains breaking changes due to the new addition of projects in ngr.config.js
.
To migrate an existing src directory:
ngr new my-new-app --src /path/to/old/src
Changelog
2.0.0-rc.2
Changelog
2.0.0-rc.1
@angular/cli^6.0.0
project to angular-rollup
ngr generate library lib-name
in any project directoryngr build dev --watch
ngr new
Changelog
2.0.0-rc.0
--rollup
and --webpack
arguments for ngr build prod
--env
argument as @angular/cli
out-css
directory in root stores temporary sass outputvendor.js
--src
property will migrate src
and config from existing angular-rollup projects to help in the upgrade processngr.config.js
, now defaults to angular.json
dist/{{projectName}}
UPDATE
The easiest way to update an existing angular-rollup project is to create a new application and migrate the existing config and src.
BREAKING CHANGE
postcss.config.js
with environment variablesTIP
Configure your tsconfig.json
to exclude
the new out-tsc
and out-css
directories.
FILESYSTEM WATCHER
In ngr.config.js
you can listen for changes in the src
or dist
folders and do something on change.
module.exports = {
buildHooks: {
dev: {
post: () => {
spawn('node_modules/.bin/rollup', ['-c', 'rollup.config.dev.js'],
{ stdio: 'inherit', shell: true });
},
watch: {
dist: (filePath) => {
if (!filePath.includes('bundle.js') &&
filePath.includes('.js')) {
spawn('node_modules/.bin/rollup', ['-c', 'rollup.config.dev.js'],
{ stdio: 'inherit', shell: true});
}
}
}
},
Changelog
2.0.0-beta.1
Changelog
2.0.0-beta.0
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.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.rollup
to ^0.55.0
. The library build now supports input
and output
syntax by defaultFor 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;
}
ngr.config.js
. The new config should look like this:BEFORE:
dep: {
lib: [],
prodLib: []
}
AFTER:
lib: {
dev: [],
prod: []
}
Changelog
1.0.8
Changelog
1.0.7
In this release, angular/rollup will pass an environment variable to process.argv. Below is an example of how you could use environment variables with a pattern similar to @angular/cli with ngr.config.js. angular-rollup
gives you control over how you implement environment variables. Copy the current environment file into the src/app folder or any other folder you desire so it can be imported into source code.
buildHooks: {
prod: {
pre: (argv) => {
var env = argv.find(a => a.includes('env')).split('=')[1];
return new Promise((res, rej)=>{
cp('environments/environment.'+env+'.ts', 'src/app/environment.ts');
res();
});
}
}
}