# Build ember-cli addon without dependencies

**URL:** <https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639>\
**Category:** Ember CLI\
**Created:** [November 7, 2014, 4:37pm UTC](https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639 "2014-11-07T16:37:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexmngn](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@alexmngn](https://discuss.emberjs.com/u/alexmngn)\
**Post date:** [November 7, 2014, 4:37pm UTC](https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639/1 "2014-11-07T16:37:27Z")

</div>

I developed an ember-cli addon that works fine. My addon is a project by itself with a dummy site to test it, a couple of unit tests etc.

When I run the command `ember build --production`, it basically creates a vendor.js file that contains my addon and all dependencies (bower\_components such ember, jquery etc…) which is about 2MB.

I’d like to know if it’s possible to export the addon on its own (vendor.js) without any dependencies inside, just as a vendor I can use? My main project that is using this addon already have ember, jquery… so I don’t want that to be duplicated.

I’m basically trying to make my ember-cli addon a component that I can include in multiple ember projects. My addon and all dev dependencies are more than 100MB of data (including node modules, express, broccoli, tests…), so when I run the command `npm install my-addon` in my main project, it installs everything (including dev dependencies, tests etc…) which is pretty big. I don’t really need that in my other project, the addon itself (dist version) should be only couple of KB and that’s all I need…

My addon looks like this:

```
/my-addon
  /addon
  /app
  /bower_components
  /node_modules
  /tests
  package.json
  Brocfile.js etc..

```

_package.json:_

```
{
  "name": "my-addon",
  "version": "0.0.1",
  "directories": {
        "doc": "doc",
        "test": "tests"
  },
  "scripts": {
        "start": "ember server",
        "build": "ember build",
        "test": "ember test"
  },
  "engines": {
        "node": ">= 0.10.0"
  },
  "devDependencies": {
        "body-parser": "^1.2.0",
        "broccoli-sass": "0.3.2",
        "broccoli-asset-rev": "0.3.1",
        "broccoli-ember-hbs-template-compiler": "^1.6.1",
        "ember-cli": "0.1.2",
        "ember-cli-content-security-policy": "0.3.0",
        "ember-cli-ic-ajax": "0.1.1",
        "ember-cli-inject-live-reload": "^1.3.0",
        "ember-cli-qunit": "0.1.0",
        "ember-data": "1.0.0-beta.10",
        "ember-export-application-global": "^1.0.0",
        "express": "^4.8.5",
        "glob": "^4.0.5"
    }
    "keywords": [
        "ember-addon"
    ],

    "ember-addon": {
        "configPath": "tests/dummy/config"
    }
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [November 7, 2014, 5:05pm UTC](https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639/2 "2014-11-07T17:05:48Z")

</div>

All you should need to do is include the addon into your consuming ember-cli app’s `package.json` (possibly via `npm install --save-dev my-addon-name`) as described in [The Ember CLI - Introduction - Ember CLI Guides](http://www.ember-cli.com/#discovery). Installing in this way should not result in the addon’s dev dependencies being re-downloaded or included into the consuming app.

---

<div class="post-metadata">

**Author:** ![alexmngn](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@alexmngn](https://discuss.emberjs.com/u/alexmngn)\
**Post date:** [November 7, 2014, 6:29pm UTC](https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639/3 "2014-11-07T18:29:04Z")

</div>

The way I’m doing it in my ember-cli app is using a git link, it looks something like that:

```
 "devDependencies": {
    "my-addon": "git+ssh://git@10.0.0.1:projects/my-addon.git#master"
  }

```

Basically, I think because it’s a link to a git repository on a private server, it downloads everything from this git repo which actually contains the full addon project

My project looks like that after the install:

```
/my-project
  /app
  /node_modules
    /my-addon
      /addon
      /app
      /bower_components
      /node_modules
      /tests
      package.json
      Brocfile.js etc..

```

---

<div class="post-metadata">

**Author:** ![kushdilip](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kushdilip/32/10266_2.png) [@kushdilip](https://discuss.emberjs.com/u/kushdilip)\
**Post date:** [March 21, 2015, 7:14am UTC](https://discuss.emberjs.com/t/build-ember-cli-addon-without-dependencies/6639/4 "2015-03-21T07:14:09Z")

</div>

@tilix I think you should add `bower_components`, `node_modules` etc to your `.gitignore` so that it doesn’t get checked in to github. Now, when your main project fetches this addon from `devDependencies`, there will be no `bower_componets`, `node_modules` in your final build.
