├── .gitignore ├── .npmignore ├── LICENSE.md ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | 7 | # dependencies 8 | /node_modules 9 | /bower_components 10 | 11 | # misc 12 | /.sass-cache 13 | /connect.lock 14 | /coverage/* 15 | /libpeerconnection.log 16 | npm-debug.log* 17 | testem.log 18 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /bower_components 2 | /config/ember-try.js 3 | /dist 4 | /tests 5 | /tmp 6 | **/.gitkeep 7 | .bowerrc 8 | .editorconfig 9 | .ember-cli 10 | .gitignore 11 | .jshintrc 12 | .watchmanconfig 13 | .travis.yml 14 | bower.json 15 | ember-cli-build.js 16 | testem.js 17 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ember-cli-one-script 2 | 3 | **[ember-cli-one-script is built and maintained by DockYard, contact us for expert Ember.js consulting](https://dockyard.com/ember-consulting)**. 4 | 5 | ## Installation 6 | `ember install ember-cli-one-script` 7 | 8 | ## Usage 9 | 10 | This addon combines your `vendor.js` and `.js` into a single 11 | file called `app.js`. 12 | 13 | You also need to update your `app/index.html`: 14 | 15 | ```html 16 | 17 | 18 | 19 | 20 | 21 | ``` 22 | 23 | ## Want to help? 24 | 25 | Please do! We are always looking to improve this library. Please see our 26 | [Contribution Guidelines](https://github.com/dockyard/ember-cli-one-script/blob/master/CONTRIBUTING.md) 27 | on how to properly submit issues and pull requests. 28 | 29 | ## Legal 30 | 31 | [DockYard](http://dockyard.com/), Inc. © 2016 32 | 33 | [@dockyard](http://twitter.com/dockyard) 34 | 35 | [Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php) 36 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 'use strict'; 3 | 4 | const concat = require('broccoli-concat'); 5 | const mergeTrees = require('broccoli-merge-trees'); 6 | 7 | module.exports = { 8 | name: 'ember-cli-one-script', 9 | 10 | postprocessTree(type, tree) { 11 | if (type !== 'all') { 12 | return tree; 13 | } 14 | 15 | return mergeTrees([tree, concat(tree, { 16 | headerFiles: [ 17 | 'assets/vendor.js', 18 | `assets/${this.project.pkg.name}.js` 19 | ], 20 | outputFile: 'assets/app.js' 21 | })]); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ember-cli-one-script", 3 | "version": "0.0.1", 4 | "description": "This addon combines your `vendor.js` and `.js` into a single file called `app.js`.", 5 | "keywords": [ 6 | "ember-addon" 7 | ], 8 | "license": "MIT", 9 | "author": "Marten Schilstra ", 10 | "repository": "https://github.com/DockYard/ember-cli-one-script", 11 | "dependencies": { 12 | "broccoli-concat": "^3.1.1", 13 | "broccoli-merge-trees": "^1.2.1" 14 | }, 15 | "engines": { 16 | "node": ">= 4.0.0" 17 | }, 18 | "ember-addon": { 19 | "before": "broccoli-asset-rev" 20 | } 21 | } 22 | --------------------------------------------------------------------------------