Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-vtex-render-route

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-vtex-render-route

A babel plugin for extracting VTEX Render route information from a component

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-vtex-render-route

A babel plugin for extracting VTEX Render route information from a component

What?

If you write the following:

import route from 'vtex.renderjs/route.js'

// Your React component code here
// Let's call this component 'Home'

export default route('home', '/')(Home)

It will extract the information on the parameters provided for the route function and append it to the babel's file metadata property. With the example above it would create something like this:

file {
  metadata {
    // Various babel's properties
    vtexRender {
      route {
        name: 'home',
        path: '/'
      }
    }
  }
}

How?

For the extraction to be succesful it depends on some rules:

  • You must make a default import from vtex.renderjs/route.js
  • The arguments given for the imported function must be string literals, for now we're not accepting variables or expressions

That's it! The name of the function isn't fixed, sou you're not required to use the name route (as written on our example).

Why?

This plugin is intended to be used in conjunction with gulp-vtex-render on the VTEX Toolbelt. Together they're able to extract route information on build time for the VTEX Render framework.

Keywords

FAQs

Package last updated on 07 Jul 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc