stylus-loader
Advanced tools
Comparing version 0.6.0 to 1.0.0
var loaderUtils = require('loader-utils'); | ||
var stylus = require('stylus'); | ||
var nib = require('nib'); | ||
var path = require('path'); | ||
@@ -23,2 +22,7 @@ var fs = require('fs'); | ||
if (options.sourceMap) { | ||
options.sourcemap = { comment: true, inline: true }; | ||
delete options.sourceMap; | ||
} | ||
var styl = stylus(source, options); | ||
@@ -72,6 +76,5 @@ var paths = [path.dirname(options.filename)]; | ||
styl.use(nib()); | ||
styl.render(function(err, css) { | ||
if (err) done(err); | ||
else done(null, css); | ||
else done(null, css, styl.sourcemap); | ||
}); | ||
@@ -78,0 +81,0 @@ }) |
{ | ||
"name": "stylus-loader", | ||
"version": "0.6.0", | ||
"version": "1.0.0", | ||
"description": "Stylus loader for webpack", | ||
@@ -20,8 +20,5 @@ "main": "index.js", | ||
"loader-utils": "~0.2.6", | ||
"stylus": "^0.49.3", | ||
"when": "~3.6.x" | ||
}, | ||
"peerDependencies": { | ||
"nib": "^1.0.4", | ||
"stylus": "^0.49.3" | ||
}, | ||
"devDependencies": { | ||
@@ -34,3 +31,2 @@ "css-loader": "~0.9.1", | ||
"should": "~4.6.1", | ||
"stylus": "^0.49.3", | ||
"webpack-dev-server": "~1.7.0" | ||
@@ -37,0 +33,0 @@ }, |
@@ -84,2 +84,4 @@ # stylus-loader | ||
## Release History | ||
* 1.0.0 - Basic source map support (@skozin). Remove nib as dep. stylus is now a direct dep (as peerDependencies are deprecated). | ||
* 0.6.0 - Support loader prefixes when resolving paths (@kpdecker). | ||
* 0.5.0 - Disable Stylus parser caching in listImports (@DaQuirm). Update to stylus@0.49.2 and nib@1.0.4 as peerDependencies (@kompot). | ||
@@ -86,0 +88,0 @@ * 0.4.0 - Allow configuration of plugins through webpack config (@bobzoller). Update to stylus 0.47.2 (@shanewilson). |
@@ -16,3 +16,3 @@ var should = require("should"); | ||
it("should import css with the css-loader", function() { | ||
var css = require("!css-loader!../!./fixtures/import-css.styl"); | ||
var css = require("!css-loader!../!./fixtures/import-css.styl").toString(); | ||
(typeof css).should.be.eql("string"); | ||
@@ -22,3 +22,3 @@ css.should.match(/\.imported-css/); | ||
it("should import stylus", function() { | ||
var css = require("!css-loader!../!./fixtures/import-styl.styl"); | ||
var css = require("!css-loader!../!./fixtures/import-styl.styl").toString(); | ||
(typeof css).should.be.eql("string"); | ||
@@ -103,3 +103,3 @@ css.should.match(/\.imported-stylus/); | ||
it("should compile an @import URL through the CSS loader", function () { | ||
var css = require("!css-loader!../!./fixtures/import-google-font.styl"); | ||
var css = require("!css-loader!../!./fixtures/import-google-font.styl").toString(); | ||
(typeof css).should.be.eql("string"); | ||
@@ -106,0 +106,0 @@ css.should.be.eql('@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic);\n'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
29144
3
7
621
1
96
0
46
+ Addedstylus@^0.49.3
- Removednib@1.2.0(transitive)