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
60015c1f
Commit
60015c1f
authored
Jan 28, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick fix
parent
c40f8176
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
index.js
index.js
+13
-12
No files found.
index.js
View file @
60015c1f
...
...
@@ -123,7 +123,8 @@ var transformServe = function(dir, anything) {
if
(
req
.
url
in
cache
)
{
return
res
.
end
(
cache
[
req
.
url
])
}
if
(
req
.
url
===
'/global-styles/base.scss'
)
debugger
if
(
!
anything
){
fixedUrl
=
req
.
url
;
}
else
{
...
...
@@ -141,11 +142,11 @@ var transformServe = function(dir, anything) {
data
=
pack
.
scss
.
shared
+
';
\
n'
+
data
;
}
sass
.
render
(
{
data
:
data
,
data
:
data
+
''
,
file
:
path
.
join
(
__dirname
,
dir
,
req
.
url
),
sourceMap
:
true
,
importer
:
function
(
url
,
prev
,
done
){
console
.
log
(
'Resolve scss dep '
,
url
,
'for'
,
fixedUrl
);
if
(
url
[
0
]
===
'/'
){
url
=
path
.
join
(
__dirname
,
dir
,
url
.
substr
(
1
));
}
...
...
@@ -154,6 +155,11 @@ var transformServe = function(dir, anything) {
let
fName
;
done
(
{
file
:
displayName
,
// only one of them is required, see section Special Behaviours.
contents
:
fs
.
readFileSync
(
name
)
+
''
}
);
return
;
let
thisOne
=
function
(
name
,
data
)
{
done
(
{
file
:
displayName
,
// only one of them is required, see section Special Behaviours.
...
...
@@ -178,7 +184,7 @@ var transformServe = function(dir, anything) {
}
else
{
thisOne
(
fName
,
res
+
''
)
}
})
}
else
{
thisOne
(
fName
,
res
+
''
)
}
})
})
;
}
...
...
@@ -284,8 +290,8 @@ var transformServe = function(dir, anything) {
let
test
=
0
;
let
iterate
=
function
()
{
let
outerFixedUrl
=
req
.
url
+
'.'
+
types
[
test
];
serve
(
req
,
res
,
function
()
{
serve
(
req
,
res
,
function
(
a
,
b
,
c
)
{
console
.
log
(
'!!!'
,
a
,
b
,
c
)
if
(
test
<
types
.
length
){
console
.
log
(
'try serve'
,
outerFixedUrl
);
test
++
;
...
...
@@ -303,13 +309,8 @@ var transformServe = function(dir, anything) {
var
count
=
0
;
var
list
=
[];
app
.
use
(
function
(
req
,
res
,
next
)
{
setTimeout
(
function
()
{
//res.end('{}')
},
1000
)
console
.
log
(
'Request'
,
req
.
url
);
next
();
});
app
.
use
(
transformServe
(
'src'
));
...
...
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