# Generating additional js file to be shared

**URL:** <https://discuss.emberjs.com/t/generating-additional-js-file-to-be-shared/13921>\
**Category:** Ember CLI\
**Created:** [November 23, 2017, 6:02pm UTC](https://discuss.emberjs.com/t/generating-additional-js-file-to-be-shared/13921 "2017-11-23T18:02:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasalguero](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasalguero/32/14267_2.png) [@jasalguero](https://discuss.emberjs.com/u/jasalguero)\
**Post date:** [November 23, 2017, 6:02pm UTC](https://discuss.emberjs.com/t/generating-additional-js-file-to-be-shared/13921/1 "2017-11-23T18:02:58Z")

</div>

I would like my Ember app to generate an extra javascript file that can be consumed by non-ember apps, so the code can be shared without creating an extra project just for it.

Inside the app, I create a public folder with two files, index.js and notifications.js to test if the pipeline is working:

```
/app
  /public
     index.js
     notification.js

```

And the files:

```
//notification.js
export function test(){console.log('test')}

//index.js
import {test} from "./notifications"; 

window.console.log('loading...');
$(document).ready(function() {
  window.console.log('initializing...');
  window.test = test;
});

```

Then in ember-cli-build file I create as a new output:

```
// ember-cli-build
app.import('app/public/index.js', { outputFile: 'assets/public.js' });

```

The transpiling seems to be working ok, but just create a module out of index.js to be imported inside the app

```
  define('app/public/index', ['app/public/notifications'], function (_notifications) {
  'use strict';

  window.console.log('loading...');

  $(document).ready(function () {
    window.console.log('initializing...');
    window.test = test;
  });
});//# sourceMappingURL=public.map

```

How can I generate a lib that can be consumed directly in the browser?
