node-sass
Advanced tools
Comparing version 0.6.7 to 0.7.0-alpha
@@ -78,2 +78,5 @@ var sass = require('../sass') | ||
var path = url.parse(req.url).pathname; | ||
if (options.prefix && 0 === path.indexOf(options.prefix)) { | ||
path = path.substring(options.prefix.length); | ||
} | ||
if (/\.css$/.test(path)) { | ||
@@ -80,0 +83,0 @@ var cssPath = join(dest, path) |
@@ -23,7 +23,9 @@ | ||
emitter.emit('write', err, options.outFile, css); | ||
if (options.stdout) { | ||
emitter.emit('log', css); | ||
} | ||
emitter.emit('render', css); | ||
}); | ||
if (options.stdout) { | ||
emitter.emit('log', css); | ||
} | ||
emitter.emit('render', css); | ||
}, | ||
@@ -30,0 +32,0 @@ error: function(error) { |
@@ -5,3 +5,3 @@ { | ||
"description": "wrapper around libsass", | ||
"version": "0.6.7", | ||
"version": "0.7.0-alpha", | ||
"homepage": "https://github.com/andrew/node-sass", | ||
@@ -28,4 +28,5 @@ "keywords": [ | ||
"scripts": { | ||
"install": "node rebuild.js", | ||
"test": "mocha test" | ||
"install": "node build.js", | ||
"test": "mocha test", | ||
"prepublish": "bash scripts/prepublish.sh" | ||
}, | ||
@@ -43,7 +44,5 @@ "bin": { | ||
"optimist": "0.6.x", | ||
"node-watch": "0.3.x" | ||
}, | ||
"devDependencies": { | ||
"mocha": "1.7.x" | ||
"node-watch": "0.3.x", | ||
"mocha": "1.13.x" | ||
} | ||
} |
@@ -95,4 +95,5 @@ ##node-sass | ||
, outputStyle: 'compressed' | ||
, prefix: '/prefix' | ||
}), | ||
connect.static(__dirname + '/public') | ||
connect.static('/prefix', __dirname + '/public') | ||
); | ||
@@ -99,0 +100,0 @@ ``` |
17
sass.js
var binding; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var v8 = 'v8-' + /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0]; | ||
var modPath = path.join(__dirname, 'bin', process.platform + '-' + process.arch + '-' + v8, 'binding'); | ||
try { | ||
@@ -10,9 +13,10 @@ if (fs.realpathSync(__dirname + '/build')) { | ||
} catch (e) { | ||
// default to a precompiled binary if no build exists | ||
var platform_full = process.platform+'-'+process.arch; | ||
binding = require(__dirname + '/precompiled/'+platform_full+'/binding'); | ||
try { | ||
fs.realpathSync(modPath + '.node'); | ||
binding = require(modPath); | ||
} catch (ex) { | ||
// No binary! | ||
throw new Error('`'+ modPath + '.node` is missing. Try reinstalling `node-sass`?'); | ||
} | ||
} | ||
if (binding === null) { | ||
throw new Error('Cannot find appropriate binary library for node-sass'); | ||
} | ||
@@ -93,2 +97,1 @@ var SASS_OUTPUT_STYLE = { | ||
exports.middleware = require('./lib/middleware'); | ||
exports.cli = require('./lib/cli'); |
@@ -70,5 +70,5 @@ var path = require('path'), | ||
emitter.on('error', done); | ||
emitter.on('render', function(css){ | ||
emitter.on('write', function(err, file, css){ | ||
assert.equal(css.trim(), 'body {\n background: red;\n color: blue; }'); | ||
fs.unlink(path.resolve(process.cwd(), 'include_path.css'), done); | ||
fs.unlink(file, done); | ||
}); | ||
@@ -80,5 +80,5 @@ }); | ||
emitter.on('error', done); | ||
emitter.on('render', function(css){ | ||
emitter.on('write', function(err, file, css){ | ||
assert.equal(css, expectedSampleCompressed); | ||
fs.unlink(path.resolve(process.cwd(), 'sample.css'), done); | ||
fs.unlink(file, done); | ||
}); | ||
@@ -90,5 +90,5 @@ }); | ||
emitter.on('error', done); | ||
emitter.on('render', function(css){ | ||
emitter.on('write', function(err, file, css){ | ||
assert.equal(css, expectedSampleNoComments); | ||
fs.unlink(path.resolve(process.cwd(), 'sample.css'), done); | ||
fs.unlink(file, done); | ||
}); | ||
@@ -101,3 +101,3 @@ }); | ||
emitter.on('error', done); | ||
emitter.on('write', function(css){ | ||
emitter.on('write', function(err, file, css){ | ||
fs.exists(resultPath, function(exists) { | ||
@@ -104,0 +104,0 @@ assert(exists); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
845
20274
168
22290933
5
7
+ Addedmocha@1.13.x
+ Addedcommander@0.6.1(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddiff@1.0.7(transitive)
+ Addedglob@3.2.3(transitive)
+ Addedgraceful-fs@2.0.3(transitive)
+ Addedgrowl@1.7.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjade@0.26.3(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.14(transitive)
+ Addedmkdirp@0.3.0(transitive)
+ Addedmocha@1.13.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedsigmund@1.0.1(transitive)