Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petermikitsh/babel-plugin-angular-inline-component
Babel plugin to Inline Angular 2+ Component templateUrl, styleUrls
https://github.com/petermikitsh/babel-plugin-angular-inline-component
angular babel component inline templates
Last synced: about 1 month ago
JSON representation
Babel plugin to Inline Angular 2+ Component templateUrl, styleUrls
- Host: GitHub
- URL: https://github.com/petermikitsh/babel-plugin-angular-inline-component
- Owner: petermikitsh
- License: mit
- Created: 2019-07-02T17:49:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T15:54:22.000Z (over 4 years ago)
- Last Synced: 2024-10-18T23:12:37.032Z (3 months ago)
- Topics: angular, babel, component, inline, templates
- Language: JavaScript
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-angular-inline-component
Babel plugin to Inline Angular 2+ Component decorator `templateUrl` and `styleUrls`.
## Usage
```
npm i github:petermikitsh/babel-plugin-angular-inline-component
```In `.babelrc`:
```
{
plugins: ['babel-plugin-angular-inline-component']
}
```## Example
### Input
```js
import { Component } from '@angular/core';@Component({
selector: 'test-component',
templateUrl: './test.component.html',
styleUrls: ['./test.component.css']
})
export class TestComponent {}
```### Output
```js
import { Component } from '@angular/core';@Component({
selector: 'test-component',
template: "\n\n",foo\nbar\n
styles: [".title {\n color: red;\n}\n"]
})
export class TestComponent {}
```### Limitations
Only `styleUrls` with a `.css` extension are supported.
### Development
This module was developed against Node `v8.15.0`.
```
npm i
npm run watch
```