Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Commit

Permalink
feat(build): add autoprefixer support
Browse files Browse the repository at this point in the history
Add support for SASS and vanilla CSS to get automatic vendor prefixes base on
the browsers selected in the Gruntfile.

Closes #317
  • Loading branch information
passy committed Aug 17, 2013
1 parent bf17e34 commit c4dfd61
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Generator.prototype.bootstrapFiles = function bootstrapFiles() {
sourceFileList: files.map(function (file) {
return 'styles/' + file.replace('.scss', '.css');
}),
searchPath: ['.tmp', 'app']
searchPath: '.tmp'
});
};

Expand Down
41 changes: 34 additions & 7 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,35 @@ module.exports = function (grunt) {
},<% if (compassBootstrap) { %>
compass: {
files: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server']
tasks: ['compass:server', 'autoprefixer']
},<% } %>
styles: {
files: ['<%%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['copy:styles', 'autoprefixer']
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'<%%= yeoman.app %>/{,*/}*.html',
'{.tmp,<%%= yeoman.app %>}/styles/{,*/}*.css',
'.tmp/styles/{,*/}*.css',
'{.tmp,<%%= yeoman.app %>}/scripts/{,*/}*.js',
'<%%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
},
autoprefixer: {
options: ['last 1 version'],
dist: {
files: [{
expand: true,
cwd: '.tmp/styles/',
src: '{,*/}*.css',
dest: '.tmp/styles/'
}]
}
},
connect: {
options: {
port: 9000,
Expand Down Expand Up @@ -269,20 +284,29 @@ module.exports = function (grunt) {
'generated/*'
]
}]
},
styles: {
expand: true,
cwd: '<%%= yeoman.app %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
},
concurrent: {
server: [
'coffee:dist'<% if (compassBootstrap) { %>,
'compass:server'<% } %>
'coffee:dist',<% if (compassBootstrap) { %>
'compass:server',<% } %>
'copy:styles'
],
test: [
'coffee'<% if (compassBootstrap) { %>,
'compass'<% } %>
'coffee',<% if (compassBootstrap) { %>
'compass',<% } %>
'copy:styles'
],
dist: [
'coffee',<% if (compassBootstrap) { %>
'compass:dist',<% } %>
'copy:styles',
'imagemin',
'svgmin',
'htmlmin'
Expand Down Expand Up @@ -328,6 +352,7 @@ module.exports = function (grunt) {
grunt.task.run([
'clean:server',
'concurrent:server',
'autoprefixer',
'connect:livereload',
'open',
'watch'
Expand All @@ -337,6 +362,7 @@ module.exports = function (grunt) {
grunt.registerTask('test', [
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'karma'
]);
Expand All @@ -345,8 +371,9 @@ module.exports = function (grunt) {
'clean:dist',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'copy',
'copy:dist',
'cdnify',
'ngmin',
'cssmin',
Expand Down
1 change: 1 addition & 0 deletions templates/common/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-imagemin": "~0.2.0",
"grunt-contrib-watch": "~0.5.2",
"grunt-autoprefixer": "~0.2.0",
"grunt-usemin": "~0.1.11",
"grunt-svgmin": "~0.2.0",
"grunt-rev": "~0.1.0",
Expand Down

1 comment on commit c4dfd61

@blackjid
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@passy I think this should close also the yeoman issue yeoman/yeoman#411
Maybe I'm wrong, I alse don't know how we deal with cross projects issues

thanks!

Please sign in to comment.