Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
cc7f166e
Commit
cc7f166e
authored
Jan 28, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scss import error handling
parent
b5e48fae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
index.js
index.js
+14
-7
No files found.
index.js
View file @
cc7f166e
...
...
@@ -118,6 +118,7 @@ var transformServe = function(dir, anything) {
let
fixedUrl
;
let
serve
=
function
(
req
,
res
,
next
)
{
var
qRes
=
res
;
if
(
req
.
url
in
cache
)
{
return
res
.
end
(
cache
[
req
.
url
])
}
...
...
@@ -162,8 +163,12 @@ var transformServe = function(dir, anything) {
if
(
err
){
fs
.
readFile
(
fName
=
name
+
'.css'
,
function
(
err
,
res
)
{
if
(
err
){
done
(
false
);
//throw new Error('what the fuck');
var
origEnd
=
qRes
.
end
;
qRes
.
end
=
function
(
data
)
{
console
.
error
(
data
);
origEnd
.
call
(
qRes
,
data
)
};
done
(
new
Error
(
'Can not resolve dependency!'
))
}
else
{
thisOne
(
fName
,
res
+
''
)
}
})
}
else
{
thisOne
(
fName
,
res
+
''
)
}
...
...
@@ -329,11 +334,13 @@ var doUpdate = async function(){
var
files
=
[];
for
(
let
filename
in
debounce
){
try
{
var
code
=
await
readFile
(
filename
)
+
''
;
var
url
=
'/'
+
path
.
relative
(
'./src'
,
filename
).
replace
(
/
\\
/g
,
'/'
)
console
.
log
(
'Live transform jsx '
,
url
)
var
result
=
await
transformJSXPromised
(
code
,
url
);
files
.
push
(
{
file
:
url
,
content
:
result
.
code
}
);
if
(
filename
.
substr
(
-
4
)
===
'.jsx'
){
var
code
=
await
readFile
(
filename
)
+
''
;
var
url
=
'/'
+
path
.
relative
(
'./src'
,
filename
).
replace
(
/
\\
/g
,
'/'
)
console
.
log
(
'Live transform jsx '
,
url
)
var
result
=
await
transformJSXPromised
(
code
,
url
);
files
.
push
(
{
file
:
url
,
content
:
result
.
code
}
);
}
}
catch
(
e
){
console
.
log
(
'Error in '
+
e
);
...
...
Write
Preview
Markdown
is supported
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