You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-bower-module

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-bower-module

Bower Module Path Resolver

0.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

babel-plugin-transform-bower-module

Bower Module Path Resolver

Example

project a structure, will be depended by other project

project-a
    |- src
        |- main.js
    |- bower.json

config project a export module with main file in bower.json

{
    "name": "project-a",
    "main": "src/main.js"
}

use project-a in project-b

project-b
    |- src
        |- b.js
    |- .bowerrc
    |- bower.json

you can change bower module directory in .bowerrc file, default is "./bower_components/"

{
    "directory": "./lib/"
}

config project b dependency in bower.json

{
    "name": "project-b",
    "dependencies": {
        "project-a": "*"
    }
}

use project-a module in b.js for project-b

import { ModuleA1, ModuleA2 } from "project-a";

// TODO something

Installation

$ npm install babel-plugin-transform-bower-module

Usage

.babelrc

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

Via CLI

$ babel --plugins transform-bower-module script.js

Via Node API

require("babel-core").transform("code", {
    plugins: ["transform-bower-module"]
});

Keywords

babel-plugin

FAQs

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