Skip to content

wacul/angular2-html-template-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wercker status npm version

angular2-html-template-loader

A webpack loader which minify html template strings in your angular2 component code.

INPUT:

@Component({
  selector: "my-component",
  template: `
    <div>
      Hello, world
    </div>
  `
})
export class MyComponent {
  //
}

OUTPUT:

@Component({
  selector: "my-component",
  template: `<div>Hello, world</div>`
})
export class MyComponent {
  //
}

Options

You can pass html-minifier options to this loader by writing them as a query string:

module: {
  loaders: [
    {
      test: /\.component\.ts$/,
      exclude: /node_modules/,
      loader: "ts!angular2-html-template?collapseWhitespace=true"
    }
  ]
}

To preserve camel-cased attribute names(e.g. *ngIf), this loader turn the caseSensitive option true by the default.

License

This software is released under the MIT License, see LICENSE.txt.

About

A webpack loader for angular2 html template strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •