angular-inline-resources
v1.3.2
Published
Inline templates and stylesheets of angular components. This utility is meant to simplify the distribution workflow of your library.
Downloads
196
Maintainers
Readme
The current package is meant to simplify the packaging workflow of an angular library, by inlining the html templates and the stylesheets of your angular components. The inlining logic is from @angular/material2 library.
Installation
npm install angular-inline-resources --save-dev
Usage
const inlineResources = require('angular-inline-resources');
const fs = require('fs-extra');
// Copy folder 'src' to 'tmp' then inline resources
Promise.resolve()
.then(() => fs.copy('src', 'tmp'))
.then(() => inlineResources('tmp'))
or in your gulp workflow:
//
// Example of a gulp task
//
gulp.task('angular:inline', () => {
return Promise.resolve()
.then(() => inlineResources('tmp'));
});
The above will process all your *.ts
or *.js
component files from , and replace all templateUrl
and styleUrls
properties to their inline equivalent.
License
MIT © Michael Bazos