# grunt-bower-dependencies-to-rjs

> auto configuration the dependencies from bower.json to target rjs file.

Latest version **0.1.4** (published 2016-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-bower-dependencies-to-rjs
pnpm add grunt-bower-dependencies-to-rjs
yarn add grunt-bower-dependencies-to-rjs
bun add grunt-bower-dependencies-to-rjs
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2016-03-21 |
| First published | 2016-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bhakarut Piboolsak |
| Maintainers | bhakarut |
| Keywords | shim |

## Links

- npm: https://www.npmjs.com/package/grunt-bower-dependencies-to-rjs
- Repository: https://github.com/BHAlrm/grunt-bower-dependencies-to-rjs
- Homepage: https://github.com/BHAlrm/grunt-bower-dependencies-to-rjs#readme
- Issues: https://github.com/BHAlrm/grunt-bower-dependencies-to-rjs/issues
- npm.io page: https://npm.io/package/grunt-bower-dependencies-to-rjs

## Dependencies (7)

- [path](https://npm.io/package/path.md) ^0.12.7
- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [requirejs](https://npm.io/package/requirejs.md) ^2.1.22
- [file-utils](https://npm.io/package/file-utils.md) ^0.2.2
- [file-system](https://npm.io/package/file-system.md) ^2.2.1
- [bower-requirejs](https://npm.io/package/bower-requirejs.md) ^1.2.0
- [main-bower-files](https://npm.io/package/main-bower-files.md) ^2.11.1

## Recent versions

- 0.1.4 (latest) — 2016-03-21
- 0.1.3 — 2016-03-11
- 0.1.2 — 2016-03-11
- 0.1.1 — 2016-03-11
- 0.1.0 — 2016-03-11
- 0.0.11 — 2016-03-11
- 0.0.10 — 2016-03-11
- 0.0.9 — 2016-03-10
- 0.0.8 — 2016-03-10
- 0.0.7 — 2016-03-10
- 0.0.5 — 2016-03-10
- 0.0.4 — 2016-03-10
- 0.0.3 — 2016-03-10
- 0.0.2 — 2016-03-10

## README

# grunt-bower-dependencies-to-rjs
> Automagically wire-up installed Bower components dependencies as shim into your RequireJS config

## Getting Started

If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a Gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

```shell
npm install grunt-bower-dependencies-to-rjs --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-bower-dependencies-to-rjs');
```

[grunt]: http://gruntjs.com
[Getting Started]: http://gruntjs.com/getting-started


## Example usage

```js
grunt.initConfig({
  bowerShimToRjs: {
    target: {
      rjsConfig: 'app/config.js'
    }
  }
});

grunt.loadNpmTasks('grunt-bower-dependencies-to-rjs');

grunt.registerTask('default', ['bowerShimToRjs']);
```

## Documentation

When the `bower` task is run it merges the paths of installed Bower components into the `paths` property of your RequireJS config.

You trigger this task from another task in your Gruntfile or through the CLI: `grunt bower`


### rjsConfig

**Required**  
Type: `String`

Specify a relative path to your RequireJS config.

Make sure to specify the `baseUrl` property in your RequireJS config if you want to use relative paths.


### Options

#### exclude

Default: `[]`  
Type: `Array`

Specify components to be excluded from being added to the RequireJS config.

```js
bowerShimToRjs: {
  all: {
    rjsConfig: 'scripts/main.js',
    options: {
      exclude: ['moment']
    }
  }
}
```

#### application.name

Default: `name of application that initial in bower.json`  
Type: `String`

Specify compress application filename it being added to the RequireJS shim config 

```js
bowerShimToRjs: {
  all: {
    rjsConfig: 'scripts/main.js',
    options: {
      application: {
        name: 'yourCompressApplicationFileName'
      }
    }
  }
}
```

#### application.exclude

Default: `[]`
Type: `Array`

Specify components of main application to be excluded from being added to the RequireJS config.

```js
bowerShimToRjs: {
  all: {
    rjsConfig: 'scripts/main.js',
    options: {
      application: {
        exclude: ['dependecy1', 'dependency2']
      }
    }
  }
}
```


#### application.overwrite

Default: `[]`
Type: `Array`

Specify components of main application to be over write name from being added to the RequireJS config.

```js
bowerShimToRjs: {
  all: {
    rjsConfig: 'scripts/main.js',
    options: {
      application: {
        overwrite: {
            'tobeoverwrotenmodulename': 'ToBeOverWriteModuleName'
        }
      }
    }
  }
}
```

## Things to remember

### Config file

If you do not already have a `config.js` file at the location specified by the `--config` option then one will be generated for you. A basic `config.js` file looks like this:

``` js
requirejs.config({
  shim: {},
  paths: {}
});
```
## Credit
Thanks for grunt-bower-requirejs's contributor(https://github.com/yeoman/grunt-bower-requirejs). I use theire module for my reference.

## License
[MIT license](http://spdx.org/licenses/MIT) and copyright Bhakarut

---
_Source: https://npm.io/package/grunt-bower-dependencies-to-rjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
