haml-transpiler-server-loader

raw JSON →
4.0.0 verified Fri May 01 auth: no javascript

Webpack loader that uses the Ruby-based haml-transpiler-server gem to transpile HAML files to HTML. Version 4.0.0 requires a separate Ruby server process (start via `hamlts`), communicating over TCP/IP. Unlike pure JavaScript HAML transpilers, this leverages the original Ruby implementation for correctness, at the cost of architectural complexity and an external dependency on Ruby and the gem. Configuration allows custom IP, port, and module export style. Suitable for projects already using Ruby HAML tooling.

error Error: connect ECONNREFUSED 127.0.0.1:5487
cause haml-transpiler-server not running or on different port
fix
Run 'hamlts' in terminal before starting webpack, or configure loader with correct port
error Module build failed: Error: Could not find Ruby gem haml-transpiler-server
cause Ruby gem not installed
fix
Run 'gem install haml-transpiler-server'
breaking Requires external Ruby haml-transpiler-server gem and running server process
fix Install Ruby, run 'gem install haml-transpiler-server', then start server with 'hamlts' before webpack
gotcha No built-in watching; file changes do not trigger re-transpilation unless webpack's watch mode is enabled
fix Use webpack --watch or integrate with watchman for automatic rebuilds
gotcha Connection errors if hamlts server not running or wrong IP/port
fix Ensure hamlts is running on default localhost:5487 or match custom configuration
npm install haml-transpiler-server-loader
yarn add haml-transpiler-server-loader
pnpm add haml-transpiler-server-loader

Webpack rule that chains file-loader and haml-transpiler-server-loader to transpile .html.haml files into standalone HTML files.

{
  test: /\.html\.haml$/,
  use: [
    {
      loader: 'file-loader',
      options: { name: '[path][name].html' }
    },
    'haml-transpiler-server-loader'
  ],
  exclude: [/node_modules/]
}