Skip to content

Commit

Permalink
Fix path.join error. Fixes GH-17.
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Sep 19, 2014
1 parent 3080723 commit b91d306
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/pathcache.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ function resolvers(options, webpackResolver) {
function(context, path) {
// Stylus calls the argument name. If it exists it should match the name
// of a module in node_modules.
if (!path) {
return null;
}
var found = utils.lookupIndex(path, options.paths, options.filename);
if (found) {
return {path: found, index: true};
Expand Down
7 changes: 6 additions & 1 deletion test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ describe("basic", function() {
it("should allow stylus plugins to be configured in webpack.config.js", function() {
var css = require("!raw-loader!../!./fixtures/webpack.config-plugin.styl");
(typeof css).should.be.eql("string");
css.should.match(/width:\s?100%;/);
css.should.match(/width:\s?100%;/);
});
it("correctly compiles mixin calls inside imported files", function () {
var css = require("!raw-loader!../!./fixtures/import-mixins/index.styl");
(typeof css).should.be.eql("string");
var regexp = new RegExp('body{color:#639;}.rule{color:#639;}main{color:#639;}');
css.replace(/\s/g, '').should.match(regexp);
});
it("should compile an @import URL through the CSS loader", function () {
var css = require("!css-loader!../!./fixtures/import-google-font.styl");
(typeof css).should.be.eql("string");
css.should.be.eql('@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic);\n');
});
});
1 change: 1 addition & 0 deletions test/fixtures/import-google-font.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url(http://fonts.googleapis.com/css?family=Open\+Sans:400,700,400italic)

0 comments on commit b91d306

Please sign in to comment.