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

babel-plugin-compact-reexports

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-compact-reexports

A Babel plugin to make re-export modules more compact

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8K
increased by19.85%
Maintainers
3
Weekly downloads
 
Created
Source

babel-plugin-compact-reexports

Build Status Coverage Status

Allows ES modules which just re-export contents of other modules to be more compact; saving you bytes over the wire.

This plugin is designed to work with loader.js, but could work with any AMD loader that supports a similar alias API.

Original discussion: ember-engines/ember-engines#265

What It Does

Given a re-export module:

// my-module.js
export { default } from 'their-module';

When using AMD, this would normally compile to something like:

define('my-module', ['exports', 'their-module'], function (exports, _theirModule) {
  'use strict';

  Object.defineProperty(exports, 'default', {
    enumerable: true,
    get: function get() {
      return _theirModule['default'];
    }
  });
});

Which is pretty verbose for a simple re-export. This plugin will rewrite the above to the following:

define.alias('their-module', 'my-module');

Keywords

FAQs

Package last updated on 18 Dec 2018

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