Skip to content

Commit

Permalink
2-spaces indentation, added vendor folder with README.md, updated Gru…
Browse files Browse the repository at this point in the history
…ntfile with copy:vendor

, added placeholders for vendor files in index.html
  • Loading branch information
michalmikolajczyk committed Mar 3, 2014
1 parent 52c3931 commit 3cfed17
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
Expand Down
8 changes: 8 additions & 0 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ module.exports = function (grunt) {
cwd: '<%%= yeoman.app %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
},
vendor: {
expand: true,
cwd: '<%%= yeoman.app %>/vendor',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
},

Expand Down Expand Up @@ -300,6 +306,7 @@ module.exports = function (grunt) {
'clean:server',
'bower-install',
'concurrent:server',
'copy:vendor',
'autoprefixer',
'connect:livereload',
'watch'
Expand All @@ -311,6 +318,7 @@ module.exports = function (grunt) {
'bower-install',
'useminPrepare',
'concurrent:dist',
'copy:vendor',
'autoprefixer',
'concat',
'copy:dist',
Expand Down
2 changes: 1 addition & 1 deletion templates/common/root/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
2 changes: 1 addition & 1 deletion templates/common/root/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
Expand Down
15 changes: 15 additions & 0 deletions templates/common/root/app/vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Why a vendor folder?

In the past week, I had two independent occasions, where I needed to manually add JS / CSS files. The first time, with [MomentJS](http://momentjs.com/) the repo was even available through bower, but it included distinct versions of the library: a regular, a minified version, a version with languages, languages minified, and bower does not seem to have the option to choose one.

The second time it was with a ionic specific repo, [ionic-contrib-frosted-glass](https://github.com/driftyco/ionic-contrib-frosted-glass) That one basically did not have a bower version.

To make it easy, I added a vendor folder with Grunt support.

## How does it work

Really simple :) Both JS and CSS files can be added here. The CSS files will be copied to .tmp folder by the copy:vendor Grunt task. There, they will be processed by the autoprefixer task. The JS files are not processed at the moment. The files need to be inserted manually into index.html, I created wrappers.

## How to disable

When there is no file in the vendor folder, nothing happens. The Grunt task copy:vendor can also be removed from grunt serve and grunt build tasks.
8 changes: 8 additions & 0 deletions templates/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->

<!-- custom vendor CSS -->
<!-- <link rel="stylesheet" href="styles/some.contrib.css"> -->
<!-- end custom vendor CSS -->

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
Expand Down Expand Up @@ -48,6 +52,10 @@
<script src="bower_components/ionic/release/js/ionic-angular.js"></script>
<!-- endbower -->
<!-- endbuild -->

<!-- custom vendor folder JS -->
<!-- <script src="vendor/someContribJs.js"></script> -->
<!-- end custom vendor JS -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
Expand Down

0 comments on commit 3cfed17

Please sign in to comment.