Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Latest commit

 

History

History
42 lines (31 loc) · 1.08 KB

readme.md

File metadata and controls

42 lines (31 loc) · 1.08 KB

⚠️ This repository has been archived. Use @proxy or asap for proxying in Architect. This plugin is not compatible with the plugins API for Architect. For an updated list other examples refer to arc.codes/examples.

@architect/proxy-plugin-jsx

Install

Ensure the plugin is installed in src/http/get-index.

cd src/http/get-index
npm i @architect/proxy-plugin-jsx

Usage

To transpile jsx into React.createElement calls:

// src/http/get-index/index.js
let arc = require('@architect/functions')

exports.handler = arc.proxy.spa({
  spa:true,
  plugins: {
    jsx: ['@architect/proxy-plugin-jsx/react']
  }
})

To transpile jsx into h calls:

// src/http/get-index/index.js
let arc = require('@architect/functions')

exports.handler = arc.proxy.spa({
  spa:true,
  plugins: {
    jsx: ['@architect/proxy-plugin-jsx/preact']
  }
})