Grunt plugin that converts AngularJS HTML templates into JavaScript to cache them in an Angular module, eliminating lazy server loads. Version 0.10.0 uses html-minifier-terser instead of html-minifier for minification. Requires Grunt >=1.0.0 (peer dependency) and Node >=10. It is a fork of grunt-html2js with up-to-date dependencies. Designed for AngularJS 1.x projects, it is not suitable for Angular 2+.
npm install grunt-html2js-terserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows Gruntfile setup: install, load plugin, configure html2js task to convert .tpl.html files into an AngularJS module for template caching.
Ensure dest is a single file path string, not an array.
Use grunt.loadNpmTasks('grunt-html2js-terser') and configure under html2js key.Use Angular CLI or other build tools for Angular 2+.
Ensure angular.module('myApp', ['yourModuleName']) matches the module option.Ensure both `src` (array of globs) and `dest` (string) are specified in the target.
Install the package: npm install grunt-html2js-terser --save-dev, then add grunt.loadNpmTasks('grunt-html2js-terser'); to Gruntfile.Create the directory or use grunt.file.mkdir before the task: grunt.file.mkdir('.tmp');