Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the capabilities for CSS to be combined as well #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@
This addon combines your `vendor.js` and `<your-app-name>.js` into a single
file called `app.js`.

This addon combines your `css.js` and `<your-app-name>.css` into a single
file called `app.css`.

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

```html
<!-- change the following -->
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/my-project.css">
<!-- to -->
<link rel="stylesheet" href="{{rootURL}}assets/app.css">

<!-- change the following -->
<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/my-project.js"></script>
Expand Down
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ module.exports = {
return tree;
}

return mergeTrees([tree, concat(tree, {
const jsTree = mergeTrees([tree, concat(tree, {
headerFiles: [
'assets/vendor.js',
`assets/${this.project.pkg.name}.js`
],
outputFile: 'assets/app.js'
})]);

return mergeTrees([jsTree, concat(jsTree, {
headerFiles: [
'assets/vendor.css',
`assets/${this.project.pkg.name}.css`
],
outputFile: 'assets/app.css'
})]);
}
};