sass-loader
Advanced tools
Comparing version 0.2.0 to 0.3.0
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
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
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
4671
56
52
3
+ Addedsass-graph@^0.1.2
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcamelcase-keys@1.0.0(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@2.1.0(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcross-spawn@0.2.9(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddiff@1.4.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgaze@0.5.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@3.1.213.2.11(transitive)
+ Addedglobule@0.1.0(transitive)
+ Addedgraceful-fs@1.2.3(transitive)
+ Addedgrowl@1.9.2(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedindent-string@1.2.2(transitive)
+ Addedinherits@1.0.2(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlodash@1.0.22.4.2(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@2.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@0.3.0(transitive)
+ Addedmkdirp@0.5.1(transitive)
+ Addedmocha@2.5.3(transitive)
+ Addedms@0.7.1(transitive)
+ Addednan@1.9.0(transitive)
+ Addednode-sass@1.2.3(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@2.1.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.10.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrepeating@1.1.3(transitive)
+ Addedreplace-ext@0.0.1(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsass-graph@0.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedsupports-color@1.2.0(transitive)
+ Addedto-iso-string@0.0.2(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddebug@2.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddiff@1.0.8(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedformatio@1.0.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedglob@3.2.3(transitive)
- Removedgopd@1.0.1(transitive)
- Removedgraceful-fs@2.0.3(transitive)
- Removedgrowl@1.8.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedmkdirp@0.5.0(transitive)
- Removedmocha@1.21.5(transitive)
- Removedms@0.6.2(transitive)
- Removednan@1.3.0(transitive)
- Removednode-sass@0.9.6(transitive)
- Removednode-sass-middleware@0.3.1(transitive)
- Removednode-watch@0.3.5(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedsamsam@1.1.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsinon@1.10.3(transitive)
- Removedutil@0.12.5(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedyargs@1.3.3(transitive)
Updatednode-sass@^1.0.1