Inline vendor and application Javascript and CSS in the index.html file.
ember-cli-all-in-one is a small Ember addon that replaces the following tags in index.html
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css" />
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css" />
<!-- ... -->
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/dummy.js"></script>
with <style>
and <script>
tags that directly include the contents of the file above.
This reduces networks requests and the above-the-fold problem often reported by Google PageSpeed Insights.
Also, when no images are used (or replacing them with inline SVG or data:
images) this addon reduces a entire Ember application to a single HTML file.
ember install ember-cli-all-in-one
In the ember-cli-build.js
file, please define a new allInOne
section.
This section can contain one of the following sub-section:
css
: Settings applied toassets/vendor.css
andassets/$APP.css
js
: Settings applied toassets/vendor.js
andassets/$APP.js
Each settings can contain any of the following options:
enabled
: If to include this kind of files directly inside theindex.html
file. The default value istrue
.preserveOriginal
: If not to delete the included file in thedist
folder. The default value isfalse
.trackReplacements
: If adddata-original-source="$PATH"
to the replacement<style>
and<script>
tags. The default value istrue
if not in production environment.
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
Copyright (C) 2016 and above Shogun mailto:[email protected].
Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.