🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

babel6-plugin-remove-imports

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

babel6-plugin-remove-imports

Strips import declarations for configured modules from babel6 output

6.1.1
latest
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Strip Filtered Imports

This plugin enables you to strip individual import declarations or specifiers when stripping code paths from a build.

For instance, you may use babel-plugin-filter-imports to remove some modules from a production build. This plugin will additionally filter a list of import declarations or specifiers that you wish to remove in conjunction with the above plugin.

API

"use strict";
// ...
const FilterImports = require('babel-plugin-filter-imports');
const StripFilteredImports = require('babel6-plugin-remove-imports');

const filteredImports = {
  'a-module-name': [
    'an-export',
    'another-export'
  ],
  'another-module-name': '*',
  'yet-another/module': true
};

// ...

new Babel('<some-path>', {
  plugins: [ 
    [FilterImports, filteredImports],
    [StripFilteredImports, filteredImports],
  ]
});

Keywords

babel

FAQs

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