Node Packaged Modules

    babel-plugin-transform-bower-module

    0.0.1 • Public • Published

    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

    Via .babelrc (Recommended)

    .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"]
    });
    

    Install

    npm i babel-plugin-transform-bower-module

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    5.28 kB

    Total Files

    6

    Last publish

    Collaborators

    • genify