Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue3115 ext in node path #3120

Merged
merged 4 commits into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";