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

babel-plugin-resolve-bower-module

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-resolve-bower-module

A Babel plugin to resolve imports that reference Bower modules

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-resolve-bower-module

Build Status

A Babel plugin to resolve ES6 imports that reference Bower modules.

Installation

npm install babel-plugin-resolve-bower-module --save-dev

In your .babelrc file add the plugin to the plugins array:

{
  "plugins": [
    "resolve-bower-module"
  ]
}

How it works

This plugin will look for import statements where the module-name matches a Bower module that is declared as a dependency or a devDependency of the project, e.g.

import foo from 'foo';

will be transformed to something like

import foo from '../../bower_components/foo/src/index';

Options

If the plugin isn't resolving paths correctly or if your bower.json isn't in process.cwd() you can pass cwd as an option to the plugin, e.g. in .babelrc specify

{
  "plugins": [
    ["resolve-bower-module", { "cwd": ".." }]
  ]
}

Keywords

FAQs

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