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
ab0c3e1b
Commit
ab0c3e1b
authored
Jan 11, 2014
by
Andrew Nesbitt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #220 from nschonni/source-comments-map-fallback
Smart defaults when only source-comment=map used
parents
fd79dcd9
2b070e74
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
cli.js
lib/cli.js
+5
-0
cli.js
test/cli.js
+18
-0
No files found.
lib/cli.js
View file @
ab0c3e1b
...
...
@@ -109,6 +109,11 @@ exports = module.exports = function(args) {
options
.
sourceComments
=
options
.
sourceComments
[
0
];
}
// Set the sourceMap path if the sourceComment was 'map', but set source-map was missing
if
(
options
.
sourceComments
===
'map'
&&
!
argv
[
'source-map'
])
{
argv
[
'source-map'
]
=
true
;
}
// set source map file and set sourceComments to 'map'
if
(
argv
[
'source-map'
])
{
options
.
sourceComments
=
'map'
;
...
...
test/cli.js
View file @
ab0c3e1b
...
...
@@ -138,4 +138,22 @@ describe('cli', function() {
});
});
it
(
'should compile a sourceMap if --source-comments="map", but the --source-map option is excluded'
,
function
(
done
){
var
emitter
=
cli
([
path
.
join
(
__dirname
,
'sample.scss'
),
'--source-comments'
,
'map'
]);
emitter
.
on
(
'error'
,
done
);
emitter
.
on
(
'write-source-map'
,
function
(
err
,
file
)
{
assert
.
equal
(
file
,
path
.
join
(
__dirname
,
'../sample.css.map'
));
fs
.
exists
(
file
,
function
(
exists
)
{
assert
(
exists
);
});
});
emitter
.
on
(
'done'
,
function
()
{
fs
.
unlink
(
path
.
join
(
__dirname
,
'../sample.css.map'
),
function
()
{
fs
.
unlink
(
path
.
join
(
__dirname
,
'../sample.css'
),
function
()
{
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