New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jsxz-loader

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsxz-loader

JSXZ Loader is a Webpack loader which allows you to Precompile your JSX HTML components from static HTML templates using CSS selectors.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

jsxz-loader

JSXZ Loader is a Webpack loader which allows you to Precompile your JSX HTML components from static HTML templates using CSS selectors.

Usage

JSXZ-loader will generate JSX output, so you have to combine it with a JSX loader if you need to ouput raw JS :

For instance, if you have a mywebsite directory containing html files of a static website, in your webpack.config setup :

module.exports = {
  ***

  module: {
    loaders: [
      { test: /.*\.jsx$/, loader: "react-hot!jsx?harmony!jsxz?dir=mywebsite" }
    ]
  },

}
  • you have a mywebsite/index.html
  • it contains a <div class="button"> element below a container of class .cart
  • you want to create a component from this button which replace the price element with this.props.price and convert the a html link into a Link component (handling OnClick for instance)

Then you can use in your sources :

module.exports = {
  showCartButton: React.createClass({
    render: function() {
      <JSXZ in="index" sel=".cart div.button">
        <Z sel="price">{this.props.price} €</Z>,
        <Z sel="a" tag="Link" to="cart"><ChildrenZ/></Z>
      </JSXZ>
    }
  }
}

Keywords

jsx

FAQs

Package last updated on 02 Mar 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