Context
Consider two packages "project-a" and "project-b".
"project-a" depends on "dependency-a" v1.0.0
"project-b" depends on "dependency-a" v2.0.0
Both projects import a file "style.less" from "dependency-a".
"project-a" should get v1.0.0 of "style.less"
"project-b" should get v2.0.0 of "style.less"
However, if you import "style.less" via an @import directive, both projects get v1.0.0 of the dependency.
Here's a reproduction of the issue:
2023-05-30_esbuild-plugin-less-bug.tgz
Expected Behavior
In my example: "project-b" has background color green (corresponding to version v2.0.0 of the dependency) in the CSS file produced.
Actual Behavior
"project-b" has background color red (corresponding to version v1.0.0 of the dependency) in the CSS file produced.
Steps to Reproduce the Problem
- Download above tarball
- run
yarn install
- run
yarn test
- see this:

Versions
esbuild: 0.17.19
esbuild-plugin-less: 1.2.0
- Platform: MacOS
Context
Consider two packages "project-a" and "project-b".
"project-a" depends on "dependency-a" v1.0.0
"project-b" depends on "dependency-a" v2.0.0
Both projects import a file "style.less" from "dependency-a".
"project-a" should get v1.0.0 of "style.less"
"project-b" should get v2.0.0 of "style.less"
However, if you import "style.less" via an
@importdirective, both projects get v1.0.0 of the dependency.Here's a reproduction of the issue:
2023-05-30_esbuild-plugin-less-bug.tgz
Expected Behavior
In my example: "project-b" has background color green (corresponding to version v2.0.0 of the dependency) in the CSS file produced.
Actual Behavior
"project-b" has background color red (corresponding to version v1.0.0 of the dependency) in the CSS file produced.
Steps to Reproduce the Problem
yarn installyarn testVersions
esbuild: 0.17.19esbuild-plugin-less: 1.2.0