【发布时间】:2020-03-27 14:30:04
【问题描述】:
我知道在 SO 和 GitHub 上有很多类似的问题,但在我的情况下都没有。
我需要一个项目来使用 gulp + browsersync 和 apache vhost(使用 MAMP PRO 5.5 创建)。
Gulp 正在工作(它完成了我需要的所有任务)。 Browsersync 已设置,但它会在与 MAMP 使用的端口不同的端口上打开我的网站。我已经使用默认端口和 Mamp 默认端口进行了测试。 Browsersync 仍然使用正确的 url 但不是正确的端口打开网站。
我知道我不能使用相同的端口,但我该如何设置 Browsersync ?
这是我的 gulp 相关部分:
gulp.task('browser-sync', ['sass', 'scripts'], function () {
browserSync.init({
open: 'external',
host: 'my-domain.dev',
proxy: 'my-domain.dev',
https: {
key: "/Users/path-to-custom-certificate/my-domain.dev.key",
cert: "/Users/path-to-custom-certificate/my-domain.dev.crt"
},
//port: 443, // If I try same port as MAMP, Browsersync increments this port ex 444
browser: "google chrome"
});
});
Mybe 可以在 APACHE 中配置一些东西吗?
【问题讨论】:
标签: macos apache gulp mamp browser-sync