1.2.0 • Published 7 years ago

grunt-ng2-inline v1.2.0

Weekly downloads
4
License
-
Repository
github
Last release
7 years ago

grunt-ng2-inline

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

Getting Started

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

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:

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().

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 and 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

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