Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including schwartzman with all npm packages installed. Try it out:

require("react/package.json"); // react is a peer dependency. var schwartzman = require("schwartzman")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

schwartzman v0.9.1

Webpack loader for Mustache


Webpack loader for Mustache. Compiles jsx.mustache files to ReactJS.

in-browser demo


Because "built-in" server-side prerender of react components requires JS VM — JSX allows for pretty complex expressions. On the other hand, every language has library for rendering Mustache templates[citation needed]. Plus, Mustache is very simple and basic. So simple, that it's easier to write a Mustache-to-JS compiler than a JSX parser for Python/Perl/PHP/Pascal/P


$ npm install --save-dev schwartzman

And add to your webpack.config.js

  • {test: /\.jsx\.mustache$/, loader: "schwartzman"} to module.loaders
    • :warning: if you use partials, you'll need to "wrap" this loader with babel-loader or any other dependency solving loader

      {test: /\.jsx\.mustache$/, loader: "babel-loader!schwartzman"}

  • '.jsx.mustache' to resolve.extensions
module.exports = {
  entry: {
    // ...
  output: {
    // ...
  module: {
    loaders: [
      // ...
      {test: /\.jsx\.mustache$/, loader: "schwartzman"},
  resolve: {
    extensions: [
      // ...
    // ...
  // ...

supported mustache blocks (with some limitations for attributes):

  • {{ variable }} and {{{ escaped_variables }}}
  • {{# section }}
  • {{^ inverted_section }}
  • {{! comment }}
  • {{> partial }}


$ npm i
$ npm test
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free