mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-09 08:00:50 +03:00
Update Gruntfile.js
- Use grunt-sass instead of compass - Update grunt build task to use postcss with autoprefixer, cssnano and pixrem
This commit is contained in:
parent
0e66834ae3
commit
16abdf0bb2
|
@ -36,9 +36,12 @@ module.exports = function (grunt) {
|
||||||
gruntfile: {
|
gruntfile: {
|
||||||
files: ['Gruntfile.js']
|
files: ['Gruntfile.js']
|
||||||
},
|
},
|
||||||
compass: {
|
sass: {
|
||||||
files: ['<%= paths.sass %>/**/*.{scss,sass}'],
|
files: ['<%= paths.sass %>/**/*.{scss,sass}'],
|
||||||
tasks: ['compass:server']
|
tasks: ['sass:dev'],
|
||||||
|
options: {
|
||||||
|
atBegin: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
livereload: {
|
livereload: {
|
||||||
files: [
|
files: [
|
||||||
|
@ -53,26 +56,43 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// see: https://github.com/gruntjs/grunt-contrib-compass
|
// see: https://github.com/sindresorhus/grunt-sass
|
||||||
compass: {
|
sass: {
|
||||||
options: {
|
dev: {
|
||||||
sassDir: '<%= paths.sass %>',
|
options: {
|
||||||
cssDir: '<%= paths.css %>',
|
outputStyle: 'nested',
|
||||||
fontsDir: '<%= paths.fonts %>',
|
sourceMap: false,
|
||||||
imagesDir: '<%= paths.images %>',
|
precision: 10
|
||||||
relativeAssets: false,
|
},
|
||||||
assetCacheBuster: false,
|
files: {
|
||||||
raw: 'Sass::Script::Number.precision = 10\n'
|
'<%= paths.css %>/project.css': '<%= paths.sass %>/project.scss'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
options: {
|
options: {
|
||||||
environment: 'production'
|
outputStyle: 'compressed',
|
||||||
}
|
sourceMap: false,
|
||||||
|
precision: 10
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
'<%= paths.css %>/project.css': '<%= paths.sass %>/project.scss'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//see https://github.com/nDmitry/grunt-postcss
|
||||||
|
postcss: {
|
||||||
|
options: {
|
||||||
|
map: true, // inline sourcemaps
|
||||||
|
|
||||||
|
processors: [
|
||||||
|
require('pixrem')(), // add fallbacks for rem units
|
||||||
|
require('autoprefixer-core')({browsers: 'last 2 versions'}), // add vendor prefixes
|
||||||
|
require('cssnano')() // minify the result
|
||||||
|
]
|
||||||
},
|
},
|
||||||
server: {
|
dist: {
|
||||||
options: {
|
src: '<%= paths.css %>/*.css'
|
||||||
// debugInfo: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -99,7 +119,8 @@ module.exports = function (grunt) {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('build', [
|
grunt.registerTask('build', [
|
||||||
'compass:dist'
|
'sass:dist',
|
||||||
|
'postcss'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask('default', [
|
grunt.registerTask('default', [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user