Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sass-loader

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-loader - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

test/src/index.sass

19

index.js

@@ -5,2 +5,3 @@ var util = require('util');

var path = require('path');
var sassGraph = require('sass-graph');

@@ -15,2 +16,7 @@

// skip empty files, otherwise it will stop webpack, see issue #21
if(opt.data.trim() == '') {
return callback(null, content);
}
// set include path to fix imports

@@ -28,7 +34,9 @@ opt.includePaths = opt.includePaths || [];

// mark dependencies
var graph = sassGraph.parseFile(this.resourcePath, {loadPaths: opt.includePaths});
graph.visitDescendents(this.resourcePath, function (imp) {
this.addDependency(imp);
}.bind(this));
opt.success = function (css) {
// mark dependencies
opt.stats.includedFiles.forEach(function(path) {
this.addDependency(path);
}, this);
callback(null, css);

@@ -38,6 +46,7 @@ }.bind(this);

opt.error = function (err) {
this.emitError(err);
callback(err);
};
}.bind(this);
sass.render(opt);
};
{
"name": "sass-loader",
"version": "0.2.0",
"version": "0.3.0",
"description": "SASS loader for Webpack",
"main": "index.js",
"scripts": {
"test": "./node_modules/webpack/bin/webpack.js -w --config=test/webpack.config.js"
"test": "rm test/output/* && node ./node_modules/webpack/bin/webpack.js -d -w --config=test/webpack.config.js"
},

@@ -22,8 +22,9 @@ "keywords": [

"loader-utils": "~0.2.2",
"node-sass": "^0.9.0"
"node-sass": "^1.0.1",
"sass-graph": "^0.1.2"
},
"devDependencies": {
"css-loader": "^0.6.12",
"webpack": "^1.2.0"
"css-loader": "^0.9.0",
"webpack": "^1.4.0"
}
}

@@ -31,3 +31,4 @@ # sass loader for [webpack](http://webpack.github.io/)

test: /\.scss$/,
loader: "style!css!sass?outputStyle=expanded"
loader: "style!css!sass?outputStyle=expanded&includePaths[]=" +
(path.resolve(__dirname, './bower_components/bootstrap-sass-official'))
}

@@ -47,3 +48,3 @@ ]

The sass-loader does not currently follow all of the webpack loader guidelines. Specifically, until the [mark and resolve dependencies](https://github.com/jtangelder/sass-loader/issues/2) feature is added, webpack will not resolve your `@import` statements for you or watch and reload when a SASS dependency changes. You can use a third party watch module to handle at least the reloading aspect for the time being.
Currently the sass-loader does not follow all of the webpack loader guidelines. The general problem is that the entry scss-file is passed to [node-sass](https://github.com/sass/node-sass) which does pretty much the rest. Thus `@import` statements inside your scss-files cannot be resolved by webpack's resolver. However, there is an [issue for that missing feature in libsass](https://github.com/sass/libsass/issues/21).

@@ -50,0 +51,0 @@ ## License

@@ -1,1 +0,4 @@

console.log(require('css!../../index.js!./index.scss'));
var scss = require('css!../../index.js!./index.scss');
var sass = require('css!../../index.js?indentedSyntax=sass!./index.sass');
console.log(scss, sass);

@@ -6,7 +6,6 @@ var path = require('path');

entry: {
test: path.join(__dirname, "src/entry.js")
test: path.join(__dirname, "src", "entry.js")
},
output: {
path: __dirname,
publicPath: "/",
path: path.join(__dirname, "output"),
filename: "[name].js",

@@ -16,4 +15,4 @@ sourceMapFilename: "[file].map"

plugins: [
new webpack.optimize.UglifyJsPlugin()
//new webpack.optimize.UglifyJsPlugin()
]
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc