我已经盯着我的 grunt 配置看了几个小时,似乎无法启动和运行。
我的文件正在我期望的地方构建(基本上就在它们所在的地方,除了车把),但我真的很难让自动刷新服务器启动并运行。无法完全启动和运行。
如果有人能指出我正确的方向,那将是一个巨大的帮助!
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
files: {
'assets/css/style.css' : 'assets/css/*.scss'
}
},
assemble: {
options: {
flatten: true,
assets: 'assets',
layout: 'templates/layouts/main.hbs'
},
pages: {
src: ['templates/*.hbs'],
dest: '.'
}
},
watch: {
all: {
files: '**/*.hbs',
tasks: ['assemble'],
options: {
livereload: true,
}
},
css: {
files: 'assets/css/*.scss',
tasks: ['sass']
},
scripts: {
files: 'assets/js/*.js',
},
livereload: {
options : { livereload: true },
files: ['/']
}
},
connect: {
options: {
port: 9001,
livereload: 35729,
hostname: '0.0.0.0',
keepalive: true,
open: true
}
}
});
grunt.loadNpmTasks('assemble');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-open');
grunt.registerTask('default',['watch','connect']);
}