我使用Grunt为我的角1应用程序和咕噜连接运行网站,但在刷新它没有退路,所以我得到一个404和白色的屏幕。
我以前用过gulp,它的连接插件有退路。
我想要解决的问题是,当我刷新浏览器时,我会松开网站,得到一个404和白色的屏幕。
我刚开始咕哝。
提供了我当前的代码:
module.exports = function(grunt) {
//Configures each plugin:
grunt.initConfig({
//This is the connect bit:
connect: {
website: {
port: 8000,
base: 'app'
}
},
sass: { // Task
dist: { // Target
options: { // Target options
style: 'expanded'
},
files: { // Dictionary of files
'app/styles/styles.css': 'app/styles/base.scss' // 'destination': 'source'
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'app/styles',
src: ['*.css', '!*.min.css'],
dest: 'app/styles',
ext: '.min.css'
}]
}
},
watch: {
css: {
files: 'app/styles/base.scss',
tasks: ['sass'],
options: {
livereload: {
host: 'localhost',
port: 8000
},
spawn: true,
interrupt: true,
debounceDelay: 250,
reload: true
},
}
}
});
//Loads libruaries:
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-connect');
//grunt.registerTask('default', ['sass', 'cssmin', 'jshint', 'connect', 'watch']);
grunt.registerTask('default', ['watch']);
};屏幕抓取bug:

发布于 2016-03-17 21:03:11
您的connect缺少选项。
connect: {
website: {
port: 8000,
base: 'app',
keepalive: true,
livereload: true
}
},https://stackoverflow.com/questions/36071523
复制相似问题