1.0.0 • Published 10 years ago

grunt-cortex-neuron-build v1.0.0

Weekly downloads
4
License
-
Repository
github
Last release
10 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

10 years ago

0.2.0

10 years ago

0.1.17

10 years ago

0.1.16

10 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 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