{"id":20046,"library":"fxa-mustache-loader","title":"fxa-mustache-loader","description":"Webpack loader for Mustache templates, designed for Firefox Accounts and compatible with Content Security Policy. Version 0.0.2, last updated in 2015, unmaintained. Generates inline JavaScript that embeds the template string, avoiding eval or dynamic code execution. Minimal alternative to mustache-loader with CSP focus, but no updates for modern webpack versions.","status":"abandoned","version":"0.0.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install fxa-mustache-loader","lang":"bash","label":"npm"},{"cmd":"yarn add fxa-mustache-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add fxa-mustache-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for template compilation","package":"mustache","optional":false},{"reason":"Used internally by webpack loaders","package":"loader-utils","optional":true}],"imports":[{"note":"CommonJS module expected by webpack loaders.","wrong":"export default function(source) { ... }","symbol":"default (loader)","correct":"module.exports = function(source) { ... }"},{"note":"use array also works, but loader property is correct.","wrong":"rules: [{ test: /\\.mustache$/, use: 'fxa-mustache-loader' }]","symbol":"Webpack rule usage","correct":"rules: [{ test: /\\.mustache$/, loader: 'fxa-mustache-loader' }]"},{"note":"Package is CJS; ESM import works only in environments that support it.","wrong":"import fxaMustacheLoader from 'fxa-mustache-loader';","symbol":"Require in Node.js (not common)","correct":"const fxaMustacheLoader = require('fxa-mustache-loader');"}],"quickstart":{"code":"// webpack.config.js\nconst path = require('path');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js'\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.mustache$/,\n        loader: 'fxa-mustache-loader'\n      }\n    ]\n  }\n};\n\n// src/template.mustache\n// <h1>{{title}}</h1>\n\n// src/index.js\nimport template from './template.mustache';\n\nconst html = template({ title: 'Hello' });\ndocument.body.innerHTML = html;","lang":"javascript","description":"Configures webpack to use fxa-mustache-loader for .mustache files, imports template as a function, and renders with data."},"warnings":[{"fix":"Switch to mustache-loader or html-loader with mustache preprocessor.","message":"Package is incompatible with webpack 4+ because it uses deprecated loader API (loader-utils v1).","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Consider using modern alternatives: handlebars-loader, marko-loader, or static template compilation.","message":"Package has not been updated since 2015; use at your own risk.","severity":"deprecated","affected_versions":"*"},{"fix":"Use require() or configure webpack appropriately.","message":"Loader returns a CommonJS module, not ES module; import may behave unexpectedly in strict ESM contexts.","severity":"gotcha","affected_versions":"*"},{"fix":"Use mustache package directly with other bundlers.","message":"Only works with webpack; no standalone usage or other bundler support.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev fxa-mustache-loader","cause":"Loader not installed or webpack cannot find it in node_modules.","error":"Module not found: Error: Can't resolve 'fxa-mustache-loader'"},{"fix":"Switch to a maintained loader like mustache-loader.","cause":"Using webpack 4+ with old loader-utils API.","error":"Error: DeprecationWarning: loaderUtils.parseQuery is deprecated"},{"fix":"Use webpack 3 or update loader.","cause":"Incompatible with webpack 5+ which changed loader context.","error":"TypeError: loaderUtils.getOptions is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}