【发布时间】:2018-09-14 12:18:36
【问题描述】:
我尝试使用 browserSync 外部 URL 在 Android 浏览器中打开我的 joomla 网站。 我使用 wamp 在 pc 上运行服务器。有没有办法在 Android 设备上设置 PHP 和 Web 服务器? 如何使用 browserSync 在我的 Android 设备上运行 joomla 或 php 站点?
我的 gulpfile.js:
var gulp = require('gulp'),
watch = require('gulp-watch'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'),
cssVars = require('postcss-advanced-variables'),
cssImport = require('postcss-import'),
nested = require('postcss-nested'),
browserSync = require('browser-sync').create();
gulp.task('styles', function() {
var processors = [
cssImport,
cssVars,
nested,
autoprefixer({
browsers: ['last 2 versions']
})
];
return gulp.src('./assets/styles/styles.css')
.pipe(postcss(processors))
.pipe(gulp.dest('./temp/styles'));
});
gulp.task('watch', function() {
browserSync.init({
proxy: "localhost/j2shop",
port: 8080,
notify: false,
watchTask: true,
debugInfo: true,
logConnections: true
});
watch('./assets/includes/**/*.php', function() {
browserSync.reload();
});
watch('./assets/styles/**/*.css', function() {
gulp.start('cssInject');
});
});
gulp.task('cssInject', ['styles'], function() {
return gulp.src('./temp/styles/styles.css')
.pipe(browserSync.stream());
});
【问题讨论】:
标签: php joomla gulp cross-browser browser-sync