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
8c4e0edf
Commit
8c4e0edf
authored
May 03, 2015
by
Michael Mifsud
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #915 from saper/libsassver
Fix #912: Use runtime libsass version
parents
2fce3035
043c5670
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
21 deletions
+34
-21
README.md
README.md
+3
-1
binding.gyp
binding.gyp
+1
-1
extensions.js
lib/extensions.js
+1
-15
index.js
lib/index.js
+18
-2
binding.cpp
src/binding.cpp
+6
-0
libsass.gyp
src/libsass.gyp
+4
-1
api.js
test/api.js
+1
-1
No files found.
README.md
View file @
8c4e0edf
...
...
@@ -354,7 +354,7 @@ console.log(result.stats);
### Version information (>= v2.0.0)
Both `node-sass` and `libsass` version info is now
present in `package.json` and is exposed via
`info` method:
Both `node-sass` and `libsass` version info is now
exposed via the
`info` method:
```
javascript
var sass = require('node-sass');
...
...
@@ -369,6 +369,8 @@ console.log(sass.info);
*
/
```
Since node-sass >=v3.0.0 libsass version is determined at run time.
## Integrations
Listing of community uses of node-sass in build tools and frameworks.
...
...
binding.gyp
View file @
8c4e0edf
...
...
@@ -22,7 +22,7 @@
'<!(node -e "require(\'nan\')")',
],
'conditions': [
['libsass_ext == ""', {
['libsass_ext == ""
or libsass_ext == "no"
', {
'dependencies': [
'src/libsass.gyp:libsass',
]
...
...
lib/extensions.js
View file @
8c4e0edf
...
...
@@ -2,8 +2,7 @@
* node-sass: lib/extensions.js
*/
var
eol
=
require
(
'os'
).
EOL
,
flags
=
{},
var
flags
=
{},
fs
=
require
(
'fs'
),
package
=
require
(
'../package.json'
),
path
=
require
(
'path'
);
...
...
@@ -109,18 +108,6 @@ function getBinaryUrl() {
return
[
site
,
'v'
+
package
.
version
,
sass
.
binaryName
].
join
(
'/'
);
}
/**
* Get Sass version information
*
* @api private
*/
function
getVersionInfo
()
{
return
[
[
'node-sass'
,
package
.
version
,
'(Wrapper)'
,
'[JavaScript]'
].
join
(
'
\
t'
),
[
'libsass '
,
package
.
libsass
,
'(Sass Compiler)'
,
'[C/C++]'
].
join
(
'
\
t'
),
].
join
(
eol
);
}
collectArguments
(
process
.
argv
.
slice
(
2
));
...
...
@@ -129,7 +116,6 @@ var sass = process.sass = {};
sass
.
binaryName
=
getBinaryName
();
sass
.
binaryUrl
=
getBinaryUrl
();
sass
.
runtime
=
getRuntimeInfo
();
sass
.
versionInfo
=
getVersionInfo
();
/**
* Get binary path.
...
...
lib/index.js
View file @
8c4e0edf
...
...
@@ -2,8 +2,10 @@
* node-sass: lib/index.js
*/
var
path
=
require
(
'path'
),
util
=
require
(
'util'
);
var
eol
=
require
(
'os'
).
EOL
,
path
=
require
(
'path'
),
util
=
require
(
'util'
),
package
=
require
(
'../package.json'
);
require
(
'./extensions'
);
...
...
@@ -14,6 +16,19 @@ require('./extensions');
var
binding
=
require
(
process
.
sass
.
getBinaryPath
(
true
));
/**
* Get Sass version information
*
* @api private
*/
function
getVersionInfo
(
binding
)
{
return
[
[
'node-sass'
,
package
.
version
,
'(Wrapper)'
,
'[JavaScript]'
].
join
(
'
\
t'
),
[
'libsass '
,
binding
.
libsassVersion
(),
'(Sass Compiler)'
,
'[C/C++]'
].
join
(
'
\
t'
),
].
join
(
eol
);
}
/**
* Get input file
*
* @param {Object} options
...
...
@@ -400,6 +415,7 @@ module.exports.renderSync = function(options) {
* @api public
*/
process
.
sass
.
versionInfo
=
getVersionInfo
(
binding
);
module
.
exports
.
info
=
process
.
sass
.
versionInfo
;
/**
...
...
src/binding.cpp
View file @
8c4e0edf
...
...
@@ -302,11 +302,17 @@ NAN_METHOD(render_file_sync) {
NanReturnValue
(
NanNew
<
Boolean
>
(
result
==
0
));
}
NAN_METHOD
(
libsass_version
)
{
NanScope
();
NanReturnValue
(
NanNew
<
String
>
(
libsass_version
()));
}
void
RegisterModule
(
v8
::
Handle
<
v8
::
Object
>
target
)
{
NODE_SET_METHOD
(
target
,
"render"
,
render
);
NODE_SET_METHOD
(
target
,
"renderSync"
,
render_sync
);
NODE_SET_METHOD
(
target
,
"renderFile"
,
render_file
);
NODE_SET_METHOD
(
target
,
"renderFileSync"
,
render_file_sync
);
NODE_SET_METHOD
(
target
,
"libsassVersion"
,
libsass_version
);
SassTypes
::
Factory
::
initExports
(
target
);
}
...
...
src/libsass.gyp
View file @
8c4e0edf
...
...
@@ -3,6 +3,9 @@
{
'target_name': 'libsass',
'type': 'static_library',
'defines': [
'LIBSASS_VERSION="<!(node -e "process.stdout.write(require(\'../package.json\').libsass)")"'
],
'sources': [
'libsass/ast.cpp',
'libsass/base64vlq.cpp',
...
...
@@ -52,7 +55,7 @@
],
'cflags_cc': [
'-fexceptions',
'-frtti'
'-frtti'
,
],
'direct_dependent_settings': {
'include_dirs': [ 'libsass' ],
...
...
test/api.js
View file @
8c4e0edf
...
...
@@ -1410,7 +1410,7 @@ describe('api', function() {
assert
(
info
.
indexOf
(
package
.
version
)
>
0
);
assert
(
info
.
indexOf
(
'(Wrapper)'
)
>
0
);
assert
(
info
.
indexOf
(
'[JavaScript]'
)
>
0
);
assert
(
info
.
indexOf
(
package
.
libsass
)
>
0
);
assert
(
info
.
indexOf
(
'[NA]'
)
<
0
);
assert
(
info
.
indexOf
(
'(Sass Compiler)'
)
>
0
);
assert
(
info
.
indexOf
(
'[C/C++]'
)
>
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