Skip to content
This repository
Browse code

Fixed less @imports

  • Loading branch information...
commit 0195aa855bf515cee571ce891ed705648970e5fe 1 parent 2cf74e3
Arnout Kazemier 3rd-Eden authored
5 lib/pre-process.js
@@ -44,7 +44,8 @@ exports.styl.extension = 'css';
44 44 */
45 45
46 46 exports.less = function less (content, index, total, next) {
47   - var file = this;
  47 + var path = require('path')
  48 + , file = this;
48 49
49 50 canihas.less(function canihasLess (err, less) {
50 51 if (err) return next(err);
@@ -55,7 +56,7 @@ exports.less = function less (content, index, total, next) {
55 56 try {
56 57 parser = less.render(content, {
57 58 filename: meta.filename
58   - , paths: [meta.path]
  59 + , paths: [meta.path, path.dirname(meta.location)]
59 60 });
60 61 }
61 62 catch (e) { return next(e); }
5 tests/fixtures/imports/less.less
... ... @@ -0,0 +1,5 @@
  1 +@pew: #4D926F;
  2 +
  3 +#body {
  4 + color: @pew;
  5 +}
2  tests/fixtures/less.less
... ... @@ -1,3 +1,5 @@
  1 +@import "./imports/less";
  2 +
1 3 @color: #4D926F;
2 4
3 5 #header {
10 tests/fixtures/mixed-square.json
... ... @@ -0,0 +1,10 @@
  1 +{
  2 + "bundle": {
  3 + "less.less": {
  4 + "description": "simple less file for pre-process testing"
  5 + },
  6 + "stylus.styl": {
  7 + "description": "simple stylus file for pre-process testing"
  8 + }
  9 + }
  10 +}

0 comments on commit 0195aa8

Please sign in to comment.
Something went wrong with that request. Please try again.