#   Nio pack

Nio pack is an extendable, yet batteries included build and packing solution for both client and server modules.

Nio pack is built on top of webpack, gulp and nodemon.

Why? Because laziness, impatience and hubris.

## Getting started

Nio pack aims to make setting up build work flows as simple and painless as possible by shipping with all the batteries included
and abstracting much of the config.

The underlying webpack config can naturally be easily extended.

### Installation

`npm i nio-pack --save-dev`

### Usage

```javascript
//webpack is exported from niopack
import niopack from 'nio-pack'
import webpack from 'nio-pack/webpack'

//package server code
let serverConfig = niopack.generate({
        target: 'server',
        entry: './app/src/server.js',
        output: './app/dist/server.bundle.js',
        devtool: '#source-maps',
        loaders: [
            //any webpack loaders that aren't already included in nio pack
        ],
        plugins: [
            //any webpack plugins that aren't already included in nio pack
        ],
        debug: true,
        env: 'development'
    })

webpack(serverConfig, ()=> {
    //handle call back
})

//package client code
let clientConfig = niopack.generate({
        target: 'client',
        entry: './app/src/server.js',
        output: './app/dist/server.bundle.js',
        devtool: '#source-maps',
        loaders: [
            //any webpack loaders that aren't already included in nio pack
        ],
        plugins: [
            //any webpack plugins that aren't already included in nio pack
        ]
        devserver: {
            port: 9090
            hot: true
        },
        debug: true,
        env: 'development'
    })

import webpackServer from 'nio-pack/webpackServer'

webpackServer(clientConfig, ()=> {
    //handle call back
})

//

```

## Webpack documentation

[documentation](http://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=documentation)


## Changelog

[changelog](http://webpack.github.io/docs/changelog.html)


## Tests

You can run the Node tests with `npm test`.
You can run the browser tests:

```
cd test/browsertests
node build
```

and open `tests.html` in the browser.

## License

Copyright (c) 2012-2015 Nubotics

MIT (http://www.opensource.org/licenses/mit-license.php)

## Dependencies

* [esprima](http://esprima.org/)
* [enhanced-resolve](https://github.com/webpack/enhanced-resolve)
* [uglify-js](https://github.com/mishoo/UglifyJS)
* [mocha](https://github.com/visionmedia/mocha)
* [should](https://github.com/visionmedia/should.js)
* [optimist](https://github.com/substack/node-optimist)
* [async](https://github.com/caolan/async)
* [mkdirp](https://github.com/substack/node-mkdirp)
* [clone](https://github.com/pvorb/node-clone)
