Skip to content

Commit

Permalink
Merge pull request #3120 from robhuzzey/issue3115_extInNodePath
Browse files Browse the repository at this point in the history
Issue3115 ext in node path
  • Loading branch information
matthew-dean committed Oct 20, 2017
2 parents 5200a20 + 9553672 commit 8d6204c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ module.exports = function (grunt) {
'test/less/*.less',
// Don't test NPM import, obviously
'!test/less/plugin-module.less',
'!test/less/import-module.less',
'!test/less/javascript.less',
'!test/less/urls.less',
'!test/less/empty.less'
Expand Down
5 changes: 2 additions & 3 deletions lib/less-node/file-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ FileManager.prototype.loadFile = function(filename, currentDirectory, options, e
}
catch (e) {}
}
else {
fullFilename = options.ext ? self.tryAppendExtension(fullFilename, options.ext) : fullFilename;
}

fullFilename = options.ext ? self.tryAppendExtension(fullFilename, options.ext) : fullFilename;

if (self.files[fullFilename]) {
fulfill({ contents: self.files[fullFilename], filename: fullFilename});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@
"grunt-eslint": "^19.0.0",
"grunt-saucelabs": "^9.0.0",
"grunt-shell": "^1.3.0",
"import-module": "file:test/import-module",
"jit-grunt": "^0.10.0",
"less-plugin-clean-css": "^1.5.1",
"performance-now": "^0.2.0",
"phantomjs-prebuilt": "^2.1.7",
"promise": "^7.1.1",
"phin": "^2.2.3",
"promise": "^7.1.1",
"time-grunt": "^1.3.0"
},
"keywords": [
Expand Down
9 changes: 9 additions & 0 deletions test/css/import-module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.three {
color: green;
}
.two {
color: blue;
}
.one {
color: red;
}
3 changes: 3 additions & 0 deletions test/import-module/one/1.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.one {
color: red;
}
3 changes: 3 additions & 0 deletions test/import-module/one/two/2.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.two {
color: blue;
}
3 changes: 3 additions & 0 deletions test/import-module/one/two/three/3.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.three {
color: green;
}
11 changes: 11 additions & 0 deletions test/import-module/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "import-module",
"version": "1.0.0",
"description": "Less files to be included in node_modules directory for testing import from node_modules",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Rob Huzzey <robert.huzzey@holidayextras.com>",
"license": "ISC"
}
3 changes: 3 additions & 0 deletions test/less/import-module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "import-module/one/two/three/3.less";
@import "import-module/one/two/2";
@import "import-module/one/1.less";

0 comments on commit 8d6204c

Please sign in to comment.