New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-react-router-optimize

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

babel-plugin-transform-react-router-optimize

Babel plugin to optimize the bundle size of projects using react-router.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
increased by30.14%
Maintainers
1
Weekly downloads
 
Created
Source

Commitizen friendly

babel-plugin-transform-react-router-optimize

The React Router library exposes all methods on the top level import, but allows developers to use imports referencing files directly inside /lib, which can result in smaller bundle sizes as it doesn't import all of the Router's dependencies.

See here for more information: Minimizing Bundle Size.

This plugin can be added to your .babelrc file and automatically transform ES2015 imports to their size optimized counterpart.

Example

In

import { Route, IndexRoute } from 'react-router';

Out

import Route from 'react-router/lib/Route';
import IndexRoute from 'react-router/lib/IndexRoute';

Installation

Note This plugin is built for babel 6 and does not work with babel 5.

npm install --save-dev babel-plugin-transform-react-router-optimize

Usage

.babelrc

{
  "plugins": ["transform-react-router-optimize"]
}

Via CLI

babel --plugins transform-react-router-optimize script.js

Via Node API

require('babel-core').transform('code', {
    plugins: ['transform-react-router-optimize']
});

License

MIT

Keywords

FAQs

Package last updated on 04 Sep 2017

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