Registry / devtools / ng-html-loader

ng-html-loader

JSON →
library0.0.3jsnpmunverified

A webpack loader that preprocesses AngularJS HTML templates with html-minifier for minification. At version 0.0.3, it is a niche utility for AngularJS projects using webpack. It has not been updated since 2016 and lacks documentation. Alternatives like html-webpack-plugin or angular-template-loader may be more modern options.

npm install ng-html-loader
INSTALL
IMPORT
SIG · NG-HTML-LOADER
N
ng-html-loader
devtoolsjavascriptv0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
require('ng-html-loader')
import ngHtmlLoader from 'ng-html-loader'
CJS only; no ESM or default export provided.

Configure webpack to minify AngularJS HTML templates using ng-html-loader.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.html$/, use: [ { loader: 'ng-html-loader', options: { // html-minifier options collapseWhitespace: true, conservativeCollapse: true } } ] } ] } };
Debug
Known issues
deprecatedPackage is unmaintained since 2016 and may not work with modern webpack versions
fix
Use html-webpack-plugin or angular-template-loader instead.
affects: >=0.0.1
gotchaNo README or documentation provided
fix
Refer to html-minifier documentation for options.
affects: >=0.0.1
gotchaRequires html-minifier as a peer dependency but does not list it in peerDependencies
fix
Install html-minifier separately: npm install html-minifier --save-dev
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'html-minifier'
Missing required dependency html-minifier
fix
npm install html-minifier --save-dev
Module parse failed: Unexpected token (1:0) in file.html
Webpack rule not configured correctly or loader not applied
fix
Ensure the test regex matches .html files and the loader is applied in the module rules.
Upgrade
Version history
0.0.3latest on npm
Audit
Dependencies
html-minifierrequiredCore minification library
Agent activity
23 hits · last 30 days
node
20
Resources
ng-html-loader — npm install ng-html-loader · libregistry