From cbd1c59758ff565cdb7e48febb63ca590725997f Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:32:01 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(gulp):=20Only=20check=20for?= =?UTF-8?q?=20cert=20files=20on=20macOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bs-config.js | 195 +++++++++++++++++++++++++++------------------------ 1 file changed, 104 insertions(+), 91 deletions(-) diff --git a/bs-config.js b/bs-config.js index b3123ee..63b355a 100644 --- a/bs-config.js +++ b/bs-config.js @@ -12,102 +12,115 @@ | */ +const os = require("os"); + const domain = "saudade.test"; -const homedir = require("os").homedir(); +const homedir = os.homedir(); const certdir = homedir + "/Library/Application Support/Herd/config/valet/Certificates/"; -module.exports = { - ui: { - port: 3001, - }, - watch: true, - ignore: [], - single: false, - watchOptions: { - ignoreInitial: true, - }, - server: false, - proxy: "https://" + domain, - port: 3000, - middleware: false, - serveStatic: [], - ghostMode: { - clicks: true, - scroll: true, - location: true, - forms: { - submit: true, - inputs: true, - toggles: true, +let config; + +if (os.type() !== "Darwin") { + config = { + proxy: "http://" + domain, + host: domain, + }; +} else { + config = { + ui: { + port: 3001, }, - }, - logLevel: "info", - logPrefix: "Browsersync", - logConnections: false, - logFileChanges: true, - logSnippet: true, - rewriteRules: [], - open: false, - browser: "default", - cors: false, - xip: false, - hostnameSuffix: false, - reloadOnRestart: false, - notify: false, - scrollProportionally: true, - scrollThrottle: 0, - scrollRestoreTechnique: "window.name", - scrollElements: [], - scrollElementMapping: [], - reloadDelay: 0, - reloadDebounce: 500, - reloadThrottle: 0, - plugins: [], - injectChanges: true, - startPath: null, - minify: true, - host: domain, - localOnly: false, - codeSync: true, - timestamps: true, - clientEvents: [ - "scroll", - "scroll:element", - "input:text", - "input:toggles", - "form:submit", - "form:reset", - "click", - ], - socket: { - socketIoOptions: { - log: false, + watch: true, + ignore: [], + single: false, + watchOptions: { + ignoreInitial: true, }, - socketIoClientConfig: { - reconnectionAttempts: 50, + server: false, + proxy: "https://" + domain, + port: 3000, + middleware: false, + serveStatic: [], + ghostMode: { + clicks: true, + scroll: true, + location: true, + forms: { + submit: true, + inputs: true, + toggles: true, + }, }, - path: "/browser-sync/socket.io", - clientPath: "/browser-sync", - namespace: "/browser-sync", - clients: { - heartbeatTimeout: 5000, + logLevel: "info", + logPrefix: "Browsersync", + logConnections: false, + logFileChanges: true, + logSnippet: true, + rewriteRules: [], + open: false, + browser: "default", + cors: false, + xip: false, + hostnameSuffix: false, + reloadOnRestart: false, + notify: false, + scrollProportionally: true, + scrollThrottle: 0, + scrollRestoreTechnique: "window.name", + scrollElements: [], + scrollElementMapping: [], + reloadDelay: 0, + reloadDebounce: 500, + reloadThrottle: 0, + plugins: [], + injectChanges: true, + startPath: null, + minify: true, + host: domain, + localOnly: false, + codeSync: true, + timestamps: true, + clientEvents: [ + "scroll", + "scroll:element", + "input:text", + "input:toggles", + "form:submit", + "form:reset", + "click", + ], + socket: { + socketIoOptions: { + log: false, + }, + socketIoClientConfig: { + reconnectionAttempts: 50, + }, + path: "/browser-sync/socket.io", + clientPath: "/browser-sync", + namespace: "/browser-sync", + clients: { + heartbeatTimeout: 5000, + }, }, - }, - tagNames: { - less: "link", - scss: "link", - css: "link", - jpg: "img", - jpeg: "img", - png: "img", - svg: "img", - gif: "img", - js: "script", - }, - injectNotification: false, - https: { - key: certdir + domain + ".key", - cert: certdir + domain + ".crt", - }, -}; + tagNames: { + less: "link", + scss: "link", + css: "link", + jpg: "img", + jpeg: "img", + png: "img", + svg: "img", + gif: "img", + js: "script", + }, + injectNotification: false, + https: { + key: certdir + domain + ".key", + cert: certdir + domain + ".crt", + }, + }; +} + +module.exports = config;