# grunt-ng2-inline

> Inline angular2 templates and styles with Grunt and angular2-inline-template-style

Latest version **1.2.0** (published 2017-10-15) · 0 weekly downloads

## Install

```sh
npm install grunt-ng2-inline
pnpm add grunt-ng2-inline
yarn add grunt-ng2-inline
bun add grunt-ng2-inline
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-10-15 |
| First published | 2016-09-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | Marcin Architek |
| Maintainers | m-architek |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-ng2-inline
- Repository: https://github.com/m-architek/grunt-ng2-inline
- Issues: https://github.com/m-architek/grunt-ng2-inline/issues
- npm.io page: https://npm.io/package/grunt-ng2-inline

## Dependencies (1)

- [angular2-inline-template-style](https://npm.io/package/angular2-inline-template-style.md) 1.2.0

## Recent versions

- 1.2.0 (latest) — 2017-10-15
- 1.0.0 — 2017-02-08
- 0.2.1 — 2016-09-20
- 0.1.0 — 2016-09-11

## README

# grunt-ng2-inline

> Inline angular2 templates and styles with [Grunt](http://gruntjs.com/) and [angular2-inline-template-style](https://github.com/ghpabs/angular2-inline-template-style)

## Getting Started

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-ng2-inline --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-ng2-inline');
```

## The "ng2_inline" task

### Overview
In your project's Gruntfile, add a section named `ng2_inline` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  ng2_inline: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});
```

### Options

#### options.base
Type: `String`  
Default value: `cwd`

Base folder for templates and stylesheet files.

#### options.compress
Type: `Boolean`
Default value: `false`

Use [html-min](https://github.com/kangax/html-minifier) and [clean-css](https://github.com/jakubpawlowicz/clean-css) to compress the templates before they are inlined.

#### options.relative
Type: `Boolean`  
Default value: `false`

Set base folder for templates and stylesheet relative to source file.

### Usage Examples

```js
grunt.initConfig({
    ng2_inline: {
        default: {
            expand: true,
            nonull: true,
            dest: 'target',
            cwd: 'src',
            src: 'app/**/*.ts',
            options: {
                base: 'src/assets',
                compress: true,
                relative: false
            }
        }
    }
});
```

## License
MIT

---
_Source: https://npm.io/package/grunt-ng2-inline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
