Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelbazos/angular-inline-resources
Inline external templates and stylesheets of components, so as to help you with the packaging of an angular library.
https://github.com/michaelbazos/angular-inline-resources
angular angular2 component-library components inline-styles inline-templates
Last synced: 23 days ago
JSON representation
Inline external templates and stylesheets of components, so as to help you with the packaging of an angular library.
- Host: GitHub
- URL: https://github.com/michaelbazos/angular-inline-resources
- Owner: michaelbazos
- License: mit
- Created: 2017-06-01T15:45:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-10T00:08:27.000Z (about 7 years ago)
- Last Synced: 2024-10-09T18:57:11.157Z (about 1 month ago)
- Topics: angular, angular2, component-library, components, inline-styles, inline-templates
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
angular-inline-resources
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](https://github.com/angular/material2) library.
## Installation
```
npm install angular-inline-resources --save-dev
```## Usage
```js
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:
```js
//
// 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](https://github.com/michaelbazos)