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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default (loader)
✓ module.exports = function(source) { ... }
✗ export default function(source) { ... }
CommonJS module expected by webpack loaders.
Webpack rule usage
✓ rules: [{ test: /\.mustache$/, loader: 'fxa-mustache-loader' }]
✗ rules: [{ test: /\.mustache$/, use: 'fxa-mustache-loader' }]
use array also works, but loader property is correct.
Require in Node.js (not common)
✓ const fxaMustacheLoader = require('fxa-mustache-loader');
✗ import fxaMustacheLoader from 'fxa-mustache-loader';
Package is CJS; ESM import works only in environments that support it.
Configures webpack to use fxa-mustache-loader for .mustache files, imports template as a function, and renders with data.
// webpack.config.js
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.mustache$/,
loader: 'fxa-mustache-loader'
}
]
}
};
// src/template.mustache
// <h1>{{title}}</h1>
// src/index.js
import template from './template.mustache';
const html = template({ title: 'Hello' });
document.body.innerHTML = html;
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'fxa-mustache-loader'
Loader not installed or webpack cannot find it in node_modules.
fixnpm install --save-dev fxa-mustache-loader
Error: DeprecationWarning: loaderUtils.parseQuery is deprecated
Using webpack 4+ with old loader-utils API.
fixSwitch to a maintained loader like mustache-loader.
TypeError: loaderUtils.getOptions is not a function
Incompatible with webpack 5+ which changed loader context.
fixUse webpack 3 or update loader.
Audit
Dependencies
mustacherequiredPeer dependency for template compilation
loader-utilsoptionalUsed internally by webpack loaders