Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
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
楚学文
node-sass
Commits
79c1965d
Commit
79c1965d
authored
Oct 15, 2013
by
Luis Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add prefix to options to remove from path
parent
586d3342
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
README.md
README.md
+2
-1
middleware.js
lib/middleware.js
+3
-0
No files found.
README.md
View file @
79c1965d
...
...
@@ -92,8 +92,9 @@ var server = connect.createServer(
,
dest
:
__dirname
+
'/public'
,
debug
:
true
,
outputStyle
:
'compressed'
,
prefix
:
'/prefix'
}),
connect
.
static
(
__dirname
+
'/public'
)
connect
.
static
(
'/prefix'
,
__dirname
+
'/public'
)
);
```
...
...
lib/middleware.js
View file @
79c1965d
...
...
@@ -75,6 +75,9 @@ module.exports = function(options){
return
function
sass
(
req
,
res
,
next
){
if
(
'GET'
!=
req
.
method
&&
'HEAD'
!=
req
.
method
)
return
next
();
var
path
=
url
.
parse
(
req
.
url
).
pathname
;
if
(
options
.
prefix
&&
0
===
path
.
indexOf
(
options
.
prefix
))
{
path
=
path
.
substring
(
options
.
prefix
.
length
);
}
if
(
/
\.
css$/
.
test
(
path
))
{
var
cssPath
=
join
(
dest
,
path
)
,
sassPath
=
join
(
src
,
path
.
replace
(
'.css'
,
'.scss'
))
...
...
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