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
67ea9c58
Commit
67ea9c58
authored
Nov 19, 2014
by
Adeel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Source-map: Parse as JSON.
parent
d58c303c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
index.js
lib/index.js
+4
-2
api.js
test/api.js
+2
-4
No files found.
lib/index.js
View file @
67ea9c58
...
...
@@ -164,6 +164,8 @@ function getOptions(options) {
};
options
.
success
=
function
(
css
,
sourceMap
)
{
sourceMap
=
JSON
.
parse
(
sourceMap
);
endStats
(
options
,
sourceMap
);
if
(
success
)
{
...
...
@@ -254,7 +256,7 @@ module.exports.renderSync = function(options) {
options
=
getOptions
(
options
);
output
=
options
.
file
?
binding
.
renderFileSync
(
options
)
:
binding
.
renderSync
(
options
);
endStats
(
options
,
options
.
stats
.
sourceMap
);
endStats
(
options
,
JSON
.
parse
(
options
.
stats
.
sourceMap
)
);
return
output
;
};
...
...
@@ -296,7 +298,7 @@ module.exports.renderFile = function(options) {
var
dir
=
path
.
dirname
(
outFile
);
var
sourceMapFile
=
path
.
resolve
(
dir
,
options
.
sourceMap
);
fs
.
writeFile
(
sourceMapFile
,
sourceMap
,
function
(
err
)
{
fs
.
writeFile
(
sourceMapFile
,
JSON
.
stringify
(
sourceMap
)
,
function
(
err
)
{
if
(
err
)
{
return
options
.
error
(
err
);
}
...
...
test/api.js
View file @
67ea9c58
...
...
@@ -421,8 +421,7 @@ describe('api', function() {
stats
:
stats
,
sourceMap
:
true
,
success
:
function
()
{
var
map
=
JSON
.
parse
(
stats
.
sourceMap
);
assert
.
equal
(
map
.
sources
[
0
],
'index.scss'
);
assert
.
equal
(
stats
.
sourceMap
.
sources
[
0
],
'index.scss'
);
done
();
}
});
...
...
@@ -516,8 +515,7 @@ describe('api', function() {
sourceMap
:
true
});
var
map
=
JSON
.
parse
(
stats
.
sourceMap
);
assert
.
equal
(
map
.
sources
[
0
],
'index.scss'
);
assert
.
equal
(
stats
.
sourceMap
.
sources
[
0
],
'index.scss'
);
done
();
});
});
...
...
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