# grunt-cortex-neuron-build

> Build cmd module to neuron wrapped module

Latest version **1.0.0** (published 2014-03-12) · 0 weekly downloads

## Install

```sh
npm install grunt-cortex-neuron-build
pnpm add grunt-cortex-neuron-build
yarn add grunt-cortex-neuron-build
bun add grunt-cortex-neuron-build
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-03-12 |
| First published | 2013-10-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | supersheep |
| Maintainers | spud, kael |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-cortex-neuron-build
- Repository: https://github.com/supersheep/grunt-cortex-neuron-build
- Issues: https://github.com/supersheep/grunt-cortex-neuron-build/issues
- npm.io page: https://npm.io/package/grunt-cortex-neuron-build

## Dependencies (8)

- [q](https://npm.io/package/q.md) ~0.9.7
- [chai](https://npm.io/package/chai.md) ~1.8.1
- [async](https://npm.io/package/async.md) ~0.2.9
- [mocha](https://npm.io/package/mocha.md) ~1.15.1
- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [fs-sync](https://npm.io/package/fs-sync.md) ~0.2.4
- [grunt-cli](https://npm.io/package/grunt-cli.md) ~0.1.11
- [module-wrapper](https://npm.io/package/module-wrapper.md) ~0.0.4

## Recent versions

- 1.0.0 (latest) — 2014-03-12
- 0.2.0 — 2014-03-12
- 0.1.17 — 2014-01-08
- 0.1.16 — 2014-01-02
- 0.1.15 — 2013-12-24
- 0.1.14 — 2013-12-19
- 0.1.13 — 2013-12-17
- 0.1.11 — 2013-12-13
- 0.1.10 — 2013-12-13
- 0.1.9 — 2013-12-13
- 0.1.8 — 2013-12-13
- 0.1.7 — 2013-12-13
- 0.1.6 — 2013-12-12
- 0.1.5 — 2013-12-12
- 0.1.4 — 2013-12-10
- … 14 more at https://npm.io/package/grunt-cortex-neuron-build/versions

## README

# grunt-cortex-neuron-build [![Build Status](https://travis-ci.org/supersheep/grunt-cortex-neuron-build.png?branch=master)](https://travis-ci.org/supersheep/grunt-cortex-neuron-build)

> build a module to neuron wrapping

```shell
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:

```js
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()`.

```js
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:
```js
{
    "name":"test-module",
    "version":"0.1.0",
    "cortex": {
        "dependencies": {
          "a": "0.0.1",
          "b": "0.0.2"
        }
    }
}
```
input.js:
```js
var a = require("a");
var b = require("b");
var c = require("./c");
var d = require("./d");
```
c.js:
```js
var d = require("./d");
```
d.js:
```js
module.exports = function(){
  console.log("I'm d");
};
```
and give such config in Gruntfile.js
```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:
```js
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

---
_Source: https://npm.io/package/grunt-cortex-neuron-build · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
