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
a63cc366
Commit
a63cc366
authored
Aug 25, 2014
by
Andrew Nesbitt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #396 from am11/omit-comments-gh#380
Option: Omit source mapping url from output file (#380)
parents
28c9018d
6591ef05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
2 deletions
+12
-2
binding.cpp
binding.cpp
+2
-0
cli.js
lib/cli.js
+7
-1
render.js
lib/render.js
+1
-0
sass.js
sass.js
+1
-0
cli.js
test/cli.js
+1
-1
No files found.
binding.cpp
View file @
a63cc366
...
...
@@ -54,6 +54,7 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx
->
options
.
image_path
=
CreateString
(
options
->
Get
(
NanNew
(
"imagePath"
)));
ctx
->
options
.
output_style
=
options
->
Get
(
NanNew
(
"style"
))
->
Int32Value
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
Int32Value
();
ctx
->
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
include_paths
=
CreateString
(
options
->
Get
(
NanNew
(
"paths"
)));
if
(
source_comments
==
SASS_SOURCE_COMMENTS_MAP
)
{
ctx
->
source_map_file
=
CreateString
(
options
->
Get
(
NanNew
(
"sourceMap"
)));
...
...
@@ -66,6 +67,7 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx
->
options
.
image_path
=
CreateString
(
options
->
Get
(
NanNew
(
"imagePath"
)));
ctx
->
options
.
output_style
=
options
->
Get
(
NanNew
(
"style"
))
->
Int32Value
();
ctx
->
options
.
source_comments
=
source_comments
=
options
->
Get
(
NanNew
(
"comments"
))
->
Int32Value
();
ctx
->
omit_source_map_url
=
options
->
Get
(
NanNew
(
"omitSourceMapUrl"
))
->
BooleanValue
();
ctx
->
options
.
include_paths
=
CreateString
(
options
->
Get
(
NanNew
(
"paths"
)));
ctx
->
options
.
precision
=
options
->
Get
(
NanNew
(
"precision"
))
->
Int32Value
();
}
...
...
lib/cli.js
View file @
a63cc366
...
...
@@ -42,6 +42,11 @@ var optimist = require('optimist')
describe
:
'Print the resulting CSS to stdout'
,
type
:
'boolean'
})
.
options
(
'omit-source-map-url'
,
{
describe
:
'Omit source map URL comment from output'
,
type
:
'boolean'
,
alias
:
'x'
})
.
options
(
'help'
,
{
describe
:
'Print usage info'
,
type
:
'string'
,
...
...
@@ -87,7 +92,8 @@ exports = module.exports = function(args) {
});
var
options
=
{
stdout
:
argv
.
stdout
stdout
:
argv
.
stdout
,
omitSourceMapUrl
:
argv
[
'omit-source-map-url'
]
};
var
inFile
=
options
.
inFile
=
argv
.
_
[
0
];
...
...
lib/render.js
View file @
a63cc366
...
...
@@ -13,6 +13,7 @@ function render(options, emitter) {
sourceMap
:
options
.
sourceMap
,
precision
:
options
.
precision
,
outFile
:
options
.
outFile
,
omitSourceMapUrl
:
options
.
omitSourceMapUrl
,
success
:
function
(
css
,
sourceMap
)
{
var
todo
=
1
;
...
...
sass.js
View file @
a63cc366
...
...
@@ -69,6 +69,7 @@ var prepareOptions = function (options) {
imagePath
:
options
.
image_path
||
options
.
imagePath
||
''
,
style
:
SASS_OUTPUT_STYLE
[
options
.
output_style
||
options
.
outputStyle
]
||
0
,
comments
:
SASS_SOURCE_COMMENTS
[
sourceComments
]
||
0
,
omitSourceMapUrl
:
options
.
omitSourceMapUrl
,
stats
:
stats
,
sourceMap
:
sourceMap
,
precision
:
parseInt
(
options
.
precision
)
||
5
,
...
...
test/cli.js
View file @
a63cc366
...
...
@@ -34,7 +34,7 @@ var sampleCssMapOutputPath = path.join(__dirname, '../sample.css.map');
describe
(
'cli'
,
function
()
{
it
(
'should print help when run with no arguments'
,
function
(
done
)
{
exec
(
'node '
+
cliPath
,
function
(
err
,
stdout
,
stderr
)
{
done
(
assert
(
stderr
.
indexOf
(
'Compile .scss files with node-sass'
)
===
0
));
done
(
assert
(
stderr
.
trim
().
indexOf
(
'Compile .scss files with node-sass'
)
===
0
));
});
});
...
...
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