Skip to content

Commit

Permalink
Initial implementation
Browse files Browse the repository at this point in the history
Initial implementation
  • Loading branch information
Marten Schilstra committed Feb 14, 2017
1 parent 71db5b9 commit c85d87c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 22 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# ember-cli-one-script

This README outlines the details of collaborating on this Ember addon.
This addon combines your `vendor.js` and `<your-app-name>.js` into a single
file called `app.js`.

## Installation
You also need to update your `app/index.html`:

* `git clone <repository-url>` this repository
* `cd ember-cli-one-script`
* `npm install`
* `bower install`
```html
<!-- change the following -->
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/my-project.js"></script>
<!-- to -->
<script src="{{rootURL}}assets/app.js"></script>
```

## Running
## Want to help?

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
Please do! We are always looking to improve this library. Please see our
[Contribution Guidelines](https://github.com/dockyard/ember-cli-one-script/blob/master/CONTRIBUTING.md)
on how to properly submit issues and pull requests.

## Running Tests
## Legal

* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`
[DockYard](http://dockyard.com/), Inc. &copy; 2016

## Building
[@dockyard](http://twitter.com/dockyard)

* `ember build`

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
[Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php)
19 changes: 18 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/* jshint node: true */
'use strict';

const concat = require('broccoli-concat');
const mergeTrees = require('broccoli-merge-trees');

module.exports = {
name: 'ember-cli-one-script'
name: 'ember-cli-one-script',

postprocessTree(type, tree) {
if (type !== 'all') {
return tree;
}

return mergeTrees([tree, concat(tree, {
headerFiles: [
'assets/vendor.js',
`assets/${this.project.pkg.name}.js`
],
outputFile: 'assets/app.js'
})]);
}
};
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "ember-cli-one-script",
"version": "0.0.0",
"description": "The default blueprint for ember-cli addons.",
"description": "This addon combines your `vendor.js` and `<your-app-name>.js` into a single file called `app.js`.",
"keywords": [
"ember-addon"
],
"license": "MIT",
"author": "",
"repository": "",
"author": "Marten Schilstra <[email protected]>",
"repository": "https://github.com/DockYard/ember-cli-one-script",
"dependencies": {
"broccoli-concat": "^3.1.1",
"broccoli-merge-trees": "^1.2.1"
},
"engines": {
"node": ">= 4.0.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
"before": "broccoli-asset-rev"
}
}

0 comments on commit c85d87c

Please sign in to comment.