Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Toolchain
sgc
Commits
3ddd73c3
Commit
3ddd73c3
authored
Oct 05, 2018
by
Philipp Nowinski
Browse files
[FEATURE] make abovethefold task optional and allow BrowserSync to serve
from filesystem
parent
c280454c
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/tasks/css.js
View file @
3ddd73c3
...
...
@@ -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
,
{
...
...
core/tasks/server.js
View file @
3ddd73c3
...
...
@@ -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
'
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment