Socket
Book a DemoInstallSign in
Socket

jsx-template-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-template-loader

Allows you to keep your react templates in a separate file, rather than inlining them. This way, your React components can stay vanilla js files. (This loader should be chained with babel-loader, see webpack.config.js example for details.)

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

jsx template loader for webpack

Allows you to keep your react templates in a separate file, rather than inlining them. This way, your React components can stay vanilla js files. (This loader should be chained with babel-loader, see webpack.config.js example for details.)

Installation

npm install jsx-template-loader

Usage

Puppy.react.js

var jsxTempl = require('jsx-template!./puppy.jsx');

export default React.createClass({
  render: function() {
    return jsxTemplate({name: 'Thunderclaw', message: 'Woof!'});
  }
});

puppy.jsx

<h1 class="name">{context.name}</h1>
<p class="message">{context.message}</p>

webpack.config.js

// ...
module: {
  loaders: [
    {
      test: /\.jsx/,
      loaders: [
        'jsx-template-loader',
        'babel-loader'
      ]
    }
  ]
}
// ...

FAQs

Package last updated on 27 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts