browserify-asterisk
Browser-side require(*/module) the DW style
Last updated a year ago by anhtrannhat .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install browserify-asterisk 
SYNC missed versions from official npm registry.

browserify-asterisk

Browserify-asterisk is one of browserify transformer which is used to transform require JS path

require(*/path/to/module)

to corresponding module (The target module is chosen from list of cartridges in cartridge paths. These cartridge paths is set in configuration file cartridgepath.json)

Getting Started

npm install browserify-asterisk

Edit grunt file to integrate browserify-asterisk with browserify

name_js_task: {
    files: [
        //js lists
    ],
    options: {
        browserifyOptions: {
            //options
        },
        transform: [
            ['browserify-asterisk',{directory: 'name of cartridge'}]
        ]
    }
}

cartridgepath.json

{
    "cartridge_one": {
        "cartridge_path": "base_cartridge_one:base_cartridge_two:cartridge_one"
    },
    "cartridge_two": {
        "cartridge_path": "base_cartridge_one:base_cartridge_two:cartridge_two"
    },
    "cartridge_three": {
        "cartridge_path": "base_cartridge_one:base_cartridge_two:cartridge_three"
    }
}

browserify-asterisk checks which cartridge it is running on, then iterate all cartridge in appropriate cartridge path, the iteration will end whenever the target module is found / or not found in every cartridge in appropriate cartridge path

The parameter directory in below statement is required

['browserify-asterisk',{directory: 'name of cartridge'}]

note with grunt-browserify

grunt-browserify build js modules with asynchrouns mode but browserify-asterisk is unable to transform js modules that grunt-browserify is running on. The solution for this issue is you should design your js tasks with synchronous mode.

Current Tags

  • 1.0.9                                ...           latest (a year ago)

10 Versions

  • 1.0.9                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 2
Last Month 35
Dependencies (2)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |