Commit 3ddd73c3 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] make abovethefold task optional and allow BrowserSync to serve

from filesystem
parent c280454c
......@@ -274,6 +274,10 @@ module.exports = class Css extends Task {
*/
async _abovethefold() {
return new Promise(async resolve => {
if (this._config.cssPipeline.abovethefold === false) {
resolve();
return;
}
const filename = path.basename(this._config.abovethefold.template);
try {
let html = await inlineSource(this._config.abovethefold.template, {
......
......@@ -9,13 +9,14 @@ module.exports = class Server extends Task {
/**
* Start the server
*
*
* @override
*/
async run(_subTask = null) {
return new Promise(resolve => {
browserSync({
proxy: this.getUrl(),
proxy: this._config.browsersync.url ? this.getUrl() : undefined,
server: this._config.browsersync.server ? this._config.browsersync.server : undefined,
middleware: (req, res, next) => {
var conjunction;
if (req.url.match(/\?/)) {
......@@ -37,7 +38,7 @@ module.exports = class Server extends Task {
getUrl() {
const configuredUrl = this._config.browsersync.url;
let desiredDomain = argv.d;
if (typeof configuredUrl === 'string') {
return configuredUrl;
} else if (typeof configuredUrl === 'object') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment