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
2e89d630
Commit
2e89d630
authored
Jun 06, 2014
by
Andrew Nesbitt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #334 from sindresorhus/fix-includepaths-renderfile
don't prepareOptions twice in `renderFile()`
parents
5e7a7e68
731e25f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
sass.js
sass.js
+0
-1
include_path.scss
test/include_path.scss
+2
-2
test.js
test/test.js
+17
-2
No files found.
sass.js
View file @
2e89d630
...
...
@@ -143,7 +143,6 @@ exports.renderSync = function(options) {
exports
.
renderFile
=
function
(
options
)
{
var
success
;
options
=
prepareOptions
(
options
);
success
=
options
.
success
;
if
(
options
.
sourceMap
===
true
)
{
options
.
sourceMap
=
path
.
basename
(
options
.
outFile
)
+
'.map'
;
...
...
test/include_path.scss
View file @
2e89d630
@import
"
lib/
vars"
;
@import
"
functions/
colorBlue"
;
@import
"vars"
;
@import
"colorBlue"
;
body
{
background
:
$color
;
color
:
colorBlue
();
}
test/test.js
View file @
2e89d630
...
...
@@ -104,6 +104,22 @@ describe('compile file with include paths', function(){
}
});
});
it
(
'should compile with renderFile'
,
function
(
done
)
{
var
testFile
=
path
.
resolve
(
__dirname
,
'tmp-include-path.css'
);
sass
.
renderFile
({
file
:
path
.
resolve
(
__dirname
,
'include_path.scss'
),
outFile
:
testFile
,
includePaths
:
[
path
.
resolve
(
__dirname
,
'lib'
),
path
.
resolve
(
__dirname
,
'functions'
)],
success
:
function
()
{
done
(
assert
.
equal
(
fs
.
readFileSync
(
testFile
,
'utf8'
),
'body {
\
n background: red;
\
n color: #0000fe; }
\
n'
));
fs
.
unlinkSync
(
testFile
);
},
error
:
function
(
error
)
{
done
(
error
);
}
});
});
});
describe
(
'compile file with image path'
,
function
(){
...
...
@@ -244,4 +260,4 @@ describe('render to file', function() {
});
});
});
\ No newline at end of file
});
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