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: 7 months 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 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T15:54:22.000Z (over 5 years ago)
- Last Synced: 2025-02-02T01:23:56.878Z (9 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 foo\n bar\n\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
```