1
저는 Grunt + browserSync + grunt-php를 사용하고 있습니다. 서버가 정상적으로 시작됩니다. 문제는 PHP 파일을 변경할 때마다 브라우저에서 이 아닌이 자동으로 다시로드된다는 것입니다. 설정이 제대로되어 있어도 수동으로 페이지를 다시로드해야합니다. 지난 1 주 동안이 문제를 해결하려고했지만 성공은 없습니다. 다른 온라인 소스를 사용해 보았지만 도움이되지 않았습니다. 도와주세요.그란트 browserSync grunt-php가 변경시 PHP 파일을 다시로드하지 않습니다.
디렉토리 구조 :
my_app/
src/
index.php
about.php
dist/
Gruntfile.js는 :
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
php: {
files: ['src/**/*.php']
}
},
browserSync: {
dev: {
bsFiles: {
src: 'src/**/*.php'
},
options: {
proxy: '127.0.0.1:8010', //our PHP server
port: 8080, // our new port
open: true,
watchTask: true
}
}
},
php: {
dev: {
options: {
port: 8010,
base: 'src'
}
}
}
});
grunt.registerTask('default', [
'php', // Using the PHP instance as a proxy
'browserSync',
'watch' // Any other watch tasks you want to run
]);
};