1.0.0 • Published 11 years ago

grunt-cortex-neuron-build v1.0.0

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

grunt-cortex-neuron-build Build Status

build a module to neuron wrapping

npm install grunt-cortex-neuron-build --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-cortex-neuron-build');

The "cortex_neuron_build" task

Overview

In your project's Gruntfile, add a section named cortex_neuron_build to the data object passed into grunt.initConfig().

grunt.initConfig({
  cortex_neuron_build: {
    test: {
      options: {
        entries: {
          "./input.js":"../expected/output-actual.js"
        },
        targetVersion: "latest",
        cwd:"./test/fixtures"
      }
    }
  }
});

Options

options.entries

Type: Object Default value: {}

A object describe src and dest as key-value.

options.targetVersion

Type: String Default value: pkg.version

A string value which will be use to describe the version of current module, default to package.version.

Usage Examples

Default Options

Let's say we have such raw files:

package.json:

{
    "name":"test-module",
    "version":"0.1.0",
    "cortex": {
        "dependencies": {
          "a": "0.0.1",
          "b": "0.0.2"
        }
    }
}

input.js:

var a = require("a");
var b = require("b");
var c = require("./c");
var d = require("./d");

c.js:

var d = require("./d");

d.js:

module.exports = function(){
  console.log("I'm d");
};

and give such config in Gruntfile.js

grunt.initConfig({
  cortex_neuron_build: {
    test: {
      options: {
        entries: {
          "./input.js":"../expected/output-actual.js"
        },
        targetVersion: "latest",
        cwd:"./test/fixtures"
      }
    }
  }
});

then we will got output-actual.js as below:

define("test-module@latest/d", [], function(require, exports, module) {
module.exports = function(){
  console.log("I'm d");
}
});
define("test-module@latest/c", ["./d"], function(require, exports, module) {
var d = require("./d");
});
define("test-module@latest", ["a@0.0.1", "b@0.0.2", "./c", "./d"], function(require, exports, module) {
var a = require("a");
var b = require("b");
var c = require("./c");
var d = require("./d");
});

Release History

2013-12-10 0.1.0 refactor code, add entries and targetVersion as option, add test cases

1.0.0

11 years ago

0.2.0

11 years ago

0.1.17

11 years ago

0.1.16

11 years ago

0.1.15

11 years ago

0.1.14

11 years ago

0.1.13

11 years ago

0.1.11

11 years ago

0.1.10

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.0

11 years ago