grunt compass 运行报错
这是我的配置gruntfiles文件
'use strict';
module.exports = function (grunt) {
var makeGruntTask = require('./grunt/makeConfig');
// var configMap = ['local', 'dev', 'uat', 'beta', 'production'];
// make progress bar of time
require('time-grunt')(grunt);
// load all grunt tasks matching the ['grunt-*', '@*/grunt-*'] patterns
require('load-grunt-tasks')(grunt, {
pattern: ['grunt-*', '@*/grunt-*']
});
grunt.event.on('watch', function (action, filepath, target) {
console.log(target + ': ' + filepath + ' has ' + action)
// grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
makeGruntTask(grunt, {
src: 'src',
dist: 'dist',
tmp: '.tmp'
});
grunt.registerTask('default', ['local']);
};
grunt config文件
'use strict';
module.exports = function (grunt, opts) {
return {
pkg: grunt.file.readJSON('package.json'),
options: opts,
connect: {
//这里为插件子刷新方式
options: {
port: 9000,
hostname: 'localhost', //默认就是这个值,可配置为本机某个 IP,localhost 或域名
livereload: 35729 //声明给 watch 监听的端口
},
server: {
options: {
open: true, //自动打开网页 http://
base: [
'.' //主目录
]
}
}
},
watch: {
includereplace: {
files: ['<%= options.src %>/html/**/*.html'],
tasks: ['includereplace']
},
gruntfile: {
files: ['Gruntfile.js']
},
styles: {
files: ['<%= options.src %>/sass/{*/,**/}*.{scss,sass}'],
tasks: ['compass']
}
},
browserSync: {
options: {
notify: false,
// run registerMultiTask()
background: true,
watchOptions: {
ignored: ''
}
},
livereload: {
options: {
files: [
'<%= options.src %>/js/{,**/}*.js',
'<%= options.src %>/images/{,**/}*.*',
'<%= options.tmp %>/{,**/}*.html',
'<%= options.tmp %>/css/{,**/}*.css',
],
port: 9000,
server: {
baseDir: ['<%= options.tmp %>', '<%= options.src %>'],
routes: {
'/bower_components': './bower_components'
}
}
}
}
},
includereplace: {
build: {
expand: true,
cwd: '<%= options.src %>/html/module',
src: '{*/,**/}*.html',
dest: '<%= options.tmp %>'
}
},
compass: {
dist: {
options: {
config: 'compass/config.rb'
}
}
},
requirejs: require('../require/config'),
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= options.src %>/images',
src: '{,*/}*.{gif,jpeg,jpg,png}',
dest: '<%= options.tmp %>/images'
}]
}
},
filerev: {
dist: {
options: {
algorithm: 'md5',
length: 16,
process: function (basename, name, extension) {
return basename + '.' + 'v' + name + '.' + extension;
}
},
src: ['<%= options.tmp %>/css/{*/,**/}/*.css']
}
},
clean: {
dist: {
files: [{
dot: true,
src: ['<%= options.dist %>{,**/}']
}]
},
server: '.tmp',
require: '.js'
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= options.src %>',
dest: '<%= options.dist %>',
src: ['fonts/{, **/}*', '*.xml', '*.ico']
},
{
expand: true,
dot: true,
cwd: '.js',
// 展平
// flatten: true,
src: ['conf/**/*.js', 'lib/require/require.js', '*.js', 'lib/oniui/{,**/}**', 'lib/{,**/,}uploadify.swf'],
dest: '<%= options.dist %>/js'
},
{
expand: true,
dot: true,
cwd: '<%= options.tmp %>',
src: ['**/*.html', 'images/**/*.*', 'css/**/*.css', '!css/**/*.css.map'],
dest: '<%= options.dist %>'
}
]
}
}
};
};
运行就会报错
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论