Skip to content

Instantly share code, notes, and snippets.

@hideki-a
Created July 7, 2014 02:29
Show Gist options
  • Save hideki-a/385bf22ee026b4a54ef2 to your computer and use it in GitHub Desktop.
Save hideki-a/385bf22ee026b4a54ef2 to your computer and use it in GitHub Desktop.
BrowserSyncに置き換えたバージョン
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
sass:
options:
sourcemap: true
compass: true
default:
files:
'../htdocs/common/css/basic.css': '../htdocs/_scss/basic.scss'
options:
style: 'expanded'
browserSync:
default:
bsFiles:
src: [
'../htdocs/**/*.css'
'../htdocs/**/*.js'
'../htdocs/**/*.html'
]
options:
watchTask: true
server:
baseDir: '../htdocs/'
# proxy: '<%= pkg.name %>.localhost'
connect:
server:
options:
port: 3000
base: '../htdocs/'
watch:
sass:
files: '../htdocs/**/*.scss'
tasks: [
'sass:default'
'autoprefixer:dist'
]
autoprefixer:
options:
browser: [
'last 2 version'
'Firefox ESR'
'ie 9'
'ie 8'
]
map: true
dist:
src: '../htdocs/common/css/basic.css'
imageoptim:
src: ['../htdocs']
options:
jpegMini: false
imageAlpha: false,
quitAfter: true
jshint:
options:
jshintrc: '.jshintrc'
all: [
'path/to/script.js'
]
uglify:
options:
preserveComments: 'some'
dist:
files:
'path/to/dest.js': ['path/to/src.js']
concat:
compo:
src: ['../htdocs/common/js/components/*.js']
dest: '../htdocs/common/js/components.js'
csslint:
dist:
src: [
'../htdocs/**/*.css'
'!../htdocs/common/css/extras/*.css'
]
options:
csslintrc: '.csslintrc'
csscomb:
files:
src: [
'../htdocs/**/*.css'
'!../htdocs/common/css/extras/*.css'
]
cmq:
dist:
files:
'../htdocs/path/to/css/' : ['../htdocs/path/to/*.css'] # Overwriting
cssmin:
dist:
files: [
expand: true
src: ['../htdocs/**/*.css']
]
xmlsitemap:
files: ['../htdocs/**/*.html']
dest: '../test/sitemap.xml'
options:
exclude: ['/_scss', '/tmpl']
host: 'http://foo.localhost'
base: '../htdocs'
exec:
validator:
cmd: 'site_validator test/sitemap.xml test/validator/report.html'
# Load grunt tasks.
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
# Register tasks.
grunt.registerTask 'default', [
'sass:default'
'autoprefixer:dist'
'configureProxies'
# 'connect'
'browserSync'
'watch'
]
grunt.registerTask 'publish', [
# 'jshint'
# 'concat'
# 'uglify'
'csslint'
'csscomb'
'cmq'
'cssmin'
'imageoptim'
]
grunt.registerTask 'server', ['connect:server:keepalive']
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment