Registry / web-framework / hamlc-loader

hamlc-loader

JSON →
library0.0.11jsnpmunverified

Webpack loader for Haml-Coffee templates, allowing import of .hamlc files as template functions. Current version 0.0.11. This package is unmaintained since 2016 and relies on deprecated dependencies like haml-coffee. It returns a function that takes locals and renders HTML. No updates in years; not recommended for new projects.

npm install hamlc-loader
INSTALL
IMPORT
SIG · HAMLC-LOADER
H
hamlc-loader
web-frameworkjavascriptv0.0.11
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
const template = require('./template.hamlc');
import template from './template.hamlc';
Webpack loaders with CommonJS exports require require() in older webpack versions. ESM import may not work without further configuration.

Shows webpack config to load .hamlc files and usage of the template function with locals.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.hamlc$/, loader: 'hamlc-loader' } ] } }; // mytemplate.hamlc .template %h1= @title // app.js const tmpl = require('./mytemplate.hamlc'); const html = tmpl({ title: 'Hello' }); console.log(html); // <div class="template">\n <h1>Hello</h1>\n</div>
Debug
Known issues
deprecatedPackage is abandoned; last update 2016. Not compatible with webpack 4+ without modification.
fix
Switch to an alternative like haml-loader or migrate to a different template engine.
affects: >=0.0.11
gotchaRequires haml-coffee as a runtime dependency; it may have incompatible versions or security issues.
fix
Ensure haml-coffee is installed and compatible; check for updates or alternatives.
affects: *
gotchaMust use CommonJS require() in webpack config and modules; ES modules may not work directly.
fix
Use require() for .hamlc files in webpack 3 or earlier.
affects: *
Errors
Common errors & fixes
Module not found: Error: Cannot resolve module 'haml-coffee'
Missing dependency haml-coffee not installed.
fix
Run 'npm install haml-coffee --save-dev'
Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
Webpack not configured with hamlc-loader for .hamlc files.
fix
Add { test: /\.hamlc$/, loader: 'hamlc-loader' } to your webpack config.
TypeError: template is not a function
Using ES import syntax 'import' instead of CommonJS 'require'.
fix
Use 'const template = require('./file.hamlc');'
Upgrade
Version history
0.0.11latest on npm
Audit
Dependencies
haml-coffeerequiredRuntime dependency for compiling Haml-Coffee templates
webpackrequiredPeer dependency; loader used with webpack
Agent activity
6 hits · last 30 days
node
6
Resources
hamlc-loader — npm install hamlc-loader · libregistry