feat(package): support less >= v3.0.0#242
feat(package): support less >= v3.0.0#242michael-ciniawsky merged 1 commit intowebpack:masterfrom thorn0:less3
less >= v3.0.0#242Conversation
|
@thorn0 look very good, thanks! |
|
For the full test coverage we'll have to run tests with both Less 2.x and 3.x. Because of this: + less.version[0] >= 3
+ ? options.ext && !tildePrefixedModuleName.test(filename)
+ ? this.tryAppendExtension(filename, options.ext)
+ : filename
+ : filename.replace(matchMalformedModuleFilename, '$1'); |
|
@thorn0 can you do this? |
|
Also the tests sometimes fail now because of the race condition in Less: less/less.js#3170 |
|
@thorn0 i think we can fix this in other PR, but if solution is simple you can do this here 👍 |
|
Re running tests with Less 2. I can do it, but not sure when. Consider merging this as is and opening an issue. |
|
Let's submit this thing! @evilebottnawi |
|
Any chance this will get submitted soon? @evilebottnawi @jhnns @d3viant0ne @michael-ciniawsky |
less >= v3.0.0
michael-ciniawsky
left a comment
There was a problem hiding this comment.
@thorn0 Thx, to clearify is this PR backwards compatible (supports both less v2.x && v3x) (🏷 Patch) or a BREAKING CHANGE (🏷 Major) ?
src/createWebpackLessPlugin.js
Outdated
| // This somewhat changed in Less 3.x. Now the file name comes without the | ||
| // automatically added extension whereas the extension is passed in as `options.ext`. | ||
| // So, if the file name matches this regexp, we simply ignore the proposed extension. | ||
| const tildePrefixedModuleName = /^~[^/\\]+$/; |
There was a problem hiding this comment.
tildePrefixedModuleName => isModule || isModuleName || isModuleRequest
src/createWebpackLessPlugin.js
Outdated
| return false; | ||
| } | ||
|
|
||
| loadFile(filename, currentDirectory, options /* , environment */) { |
There was a problem hiding this comment.
Either enviroment is needed or not, but please don't leave commented stuff
|
Seems to be a semver patch (Waiting for feedback) |
- "less": "^2.3.1",
+ "less": "^2.0.0 || ^3.0.0", |
|
Why not |
|
Only the major version is important here imho, this avoids noisy false warnings within the specified semver major ranges, e.g would |
|
I respectfully disagree. Minor version means added features. Are you sure we don't use any features added between 2.0 and 2.3? You're not, so why change this? |
|
Sure you can keep the status quo and just add |
|
@thorn0 Thx |
|
@thorn0, go for it! |
|
@thorn0 You rightfully opened this against the |
|
@michael-ciniawsky done, pls have a look |
test/helpers/compile.js
Outdated
| const entry = path.resolve(fixturePath, 'less', `${fixture}.less`); | ||
|
|
||
| webpack({ | ||
| const [majorVersion] = webpackPackageJson.version.split('.'); |
There was a problem hiding this comment.
Please drop this, I appreciate that you want to fix it, but adding webpack >= v4.0.0 to the CI setup will be part of #233 asap. The loader works with the webpack >= v4.0.0 Loader API (no affecting breaking changes between v3.0.0 => v4.0.0)
There was a problem hiding this comment.
Are you sure? The tests don't pass without this change.
There was a problem hiding this comment.
Yep, I'm sure about that, please pin webpack to ^3.0.0 (https://github.com/webpack-contrib/less-loader/blob/master/package.json#L65) instead
michael-ciniawsky
left a comment
There was a problem hiding this comment.
One thing to drop and g2g :)
Closes #239
|
is it good to be merged ? |
|
Any update on when this will be merged? |
less >= v3.0.0less >= v3.0.0
|
Released in |
Issuesless >= v3.0.0#239